Class FileUtils

java.lang.Object
org.deltava.util.FileUtils

public class FileUtils extends Object
A utility class for filesystem functions.
Since:
4.2
Version:
10.0
Author:
Luke
  • Field Details

  • Method Details

    • findNewest

      public static File findNewest(String path, FilenameFilter ff)
      Returns the newest file in a directory.
      Parameters:
      path - the directory path
      ff - a FilenameFilter to limit files selected
      Returns:
      the File, or null if empty
    • fileFilter

      public static FilenameFilter fileFilter(String prefix, String ext)
      Utility method to get filenames with a particular prefix and extension.
      Parameters:
      prefix - the prefix
      ext - the extension
      Returns:
      a FilenameFilter
    • setOwner

      public static void setOwner(File f, String owner, String group) throws IOException
      Sets the owner and group membership for a file.
      Parameters:
      f - the File
      owner - the owner name
      group - the group name
      Throws:
      IOException - if an error occurs
    • setPermissions

      public static void setPermissions(File f, String... permissions) throws IOException
      Sets the permissions for a file.
      Parameters:
      f - the File
      permissions - the permission names
      Throws:
      IOException - if an error occurs
      See Also: