Package org.oddjob.io

Class FilesUtil

java.lang.Object
org.oddjob.io.FilesUtil

public class FilesUtil extends Object
Utility methods for dealing with files.
Author:
Rob Gordon
  • Constructor Details

    • FilesUtil

      public FilesUtil()
  • Method Details

    • expand

      public static File[] expand(File file) throws IOException
      Expand a file that could contain wild cards.
      Parameters:
      file - The file.
      Returns:
      An array of files. Never null.
      Throws:
      IOException
    • expand

      public static File[] expand(File[] files) throws IOException
      Expand an array of files which could contain wildcards into an actual array of files. The array will be sorted.
      Parameters:
      files - The in files.
      Returns:
      The expanded files
      Throws:
      IOException
    • verifyReadable

      public static void verifyReadable(File[] files) throws RuntimeException
      Verify that all files are readable.
      Parameters:
      files - The files.
      Throws:
      RuntimeException
    • verifyWrite

      public static void verifyWrite(File file) throws RuntimeException
      Verify that a file is writeable.
      Parameters:
      file - A file.
      Throws:
      RuntimeException
    • verifyWrite

      public static void verifyWrite(File[] files) throws RuntimeException
      Verify that files are writeable.
      Parameters:
      files - The files.
      Throws:
      RuntimeException