Class FileSystemUtil

java.lang.Object
fr.paris.lutece.util.filesystem.FileSystemUtil

public final class FileSystemUtil extends Object
This Service is used to manipulate Files and Directories in the File System.
  • Method Details

    • getSubDirectories

      public static List<File> getSubDirectories(String strRoot, String strDirectoryRelativePath) throws DirectoryNotFoundException
      Returns the sub-directories of a directory.
      Parameters:
      strRoot - the root directory.
      strDirectoryRelativePath - the parent directory.
      Returns:
      The list of sub-directories.
      Throws:
      DirectoryNotFoundException - if the directory does not exist.
    • getFiles

      public static List<File> getFiles(String strRoot, String strDirectoryRelativePath) throws DirectoryNotFoundException
      Returns the files of a directory, alphabetically ordered.
      Parameters:
      strRoot - The root directory
      strDirectoryRelativePath - The directory's path relative to the root directory.
      Returns:
      The list of files.
      Throws:
      DirectoryNotFoundException - if the directory does not exist.
    • getMIMEType

      public static String getMIMEType(String strFilename)
      Return the mimetype of the file depending of his extension and the mime.types file
      Parameters:
      strFilename - the file name
      Returns:
      the file mime type