Package fr.paris.lutece.util.filesystem
Class FileSystemUtil
- java.lang.Object
-
- fr.paris.lutece.util.filesystem.FileSystemUtil
-
public final class FileSystemUtil extends java.lang.ObjectThis Service is used to manipulate Files and Directories in the File System.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.io.File>getFiles(java.lang.String strRoot, java.lang.String strDirectoryRelativePath)Returns the files of a directory, alphabetically ordered.static java.lang.StringgetMIMEType(java.lang.String strFilename)Return the mimetype of the file depending of his extension and the mime.types filestatic java.util.List<java.io.File>getSubDirectories(java.lang.String strRoot, java.lang.String strDirectoryRelativePath)Returns the sub-directories of a directory.
-
-
-
Method Detail
-
getSubDirectories
public static java.util.List<java.io.File> getSubDirectories(java.lang.String strRoot, java.lang.String strDirectoryRelativePath) throws DirectoryNotFoundExceptionReturns 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 java.util.List<java.io.File> getFiles(java.lang.String strRoot, java.lang.String strDirectoryRelativePath) throws DirectoryNotFoundExceptionReturns the files of a directory, alphabetically ordered.- Parameters:
strRoot- The root directorystrDirectoryRelativePath- 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 java.lang.String getMIMEType(java.lang.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
-
-