Interface FileUtils


public interface FileUtils
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static boolean
    isWritable(String filePath)
    Checks if the specified file path can be written to.
  • Method Details

    • isWritable

      static boolean isWritable(String filePath)
      Checks if the specified file path can be written to.

      The method logic is OS-dependent. On Windows, a (possibly existing) file is considered writable if a new FileOutputStream can be opened for it. On other operating systems (Linux, MacOS), a file is considered writable if it does not exist.

      Parameters:
      filePath - full path to the file
      Returns:
      true if the file can be written using the specified path; false otherwise