FileDeleteStrategy.ForceFileDeleteStrategy (Commons IO 2.5)
Date: 2016-12-01

org.apache.commons.io

## Class FileDeleteStrategy.ForceFileDeleteStrategy

- java.lang.Object
- - org.apache.commons.io.FileDeleteStrategy
  - - org.apache.commons.io.FileDeleteStrategy.ForceFileDeleteStrategy

- Enclosing class:
    FileDeleteStrategy

      static class FileDeleteStrategy.ForceFileDeleteStrategy
      extends FileDeleteStrategy

  Force file deletion strategy.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.commons.io.FileDeleteStrategy

      `FileDeleteStrategy.ForceFileDeleteStrategy`

  - ### Field Summary

    - ### Fields inherited from class org.apache.commons.io.FileDeleteStrategy

      `FORCE, NORMAL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileDeleteStrategy.ForceFileDeleteStrategy()` Default Constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `doDelete(java.io.File fileToDelete)` Deletes the file object.

    - ### Methods inherited from class org.apache.commons.io.FileDeleteStrategy

      `delete, deleteQuietly, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### FileDeleteStrategy.ForceFileDeleteStrategy

          FileDeleteStrategy.ForceFileDeleteStrategy()

      Default Constructor

  - ### Method Detail

    - #### doDelete

          protected boolean doDelete(java.io.File fileToDelete)
                              throws java.io.IOException

      Deletes the file object.

      This implementation uses `FileUtils.forceDelete()` if the file exists.

      Overrides:
        `doDelete` in class `FileDeleteStrategy`
      Parameters:
        `fileToDelete` - the file to delete, not null
      Returns:
        Always returns `true`
      Throws:
        `java.lang.NullPointerException` - if the file is null
        `java.io.IOException` - if an error occurs during file deletion

Copyright (c) 2002-2016 Apache Software Foundation