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
    `ForceFileDeleteStrategy()` Default Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `doDelete(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

    - #### ForceFileDeleteStrategy

          ForceFileDeleteStrategy()

      Default Constructor

  - ### Method Detail

    - #### doDelete

          protected boolean doDelete(File fileToDelete)
                              throws 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:
        `NullPointerException` - if the file is null
        `IOException` - if an error occurs during file deletion