Class FileUtils


  • public abstract class FileUtils
    extends Object
    Collection of utility methods to work with files.
    Since:
    1.0
    Version:
    $Revision: 3108 $
    Author:
    Geert Bevin (gbevin[remove] at uwyn dot com)
    • Method Detail

      • getFileList

        public static ArrayList getFileList​(File file,
                                            Pattern[] included,
                                            Pattern[] excluded)
        Recursively traverse a directory hierachy and obtain a list of all absolute file names.

        Regular expression patterns can be provided to explicitly include and exclude certain file names.

        Parameters:
        file - the directory whose file hierarchy will be traversed
        included - an array of regular expression patterns that will be used to determine which files should be included; or

        null if all files should be included

        excluded - an array of regular expression patterns that will be used to determine which files should be excluded; or

        null if no files should be excluded

        Returns:
        the list of absolute file names
        Since:
        1.0
      • getExtension

        public static String getExtension​(String fileName)