public class FileManagerImpl extends java.lang.Object implements FileManager
APPLICATION_DATA| Modifier and Type | Method and Description |
|---|---|
void |
addFileListener(HecFile file,
FileListener listener) |
boolean |
createDirectory(java.lang.String dirName)
create the directory (and parent directories if necessary) specified by
dirName
|
boolean |
deleteDirectory(java.io.File path)
delete the directory and everything in it.
|
boolean |
fileExists(java.lang.String path) |
HecFile |
getFile(java.lang.String path)
get the file specified by path.
|
HecFile |
getFile(java.lang.String path,
boolean createDirIfNeeded)
get the file specified by path.
|
int |
getFileCount(java.lang.String dirToCount)
get the count of all files in the directory tree dirToCount
|
static FileManager |
getFileManager() |
HecFile |
getUserPreferencesFile(java.lang.String relativePath)
get
|
java.util.List<java.lang.String> |
list(java.lang.String directory,
java.io.FilenameFilter filter)
get a listing of the files in the folder directory that match the
FilenameFilter filter
|
java.util.List<java.lang.String> |
list(java.lang.String directory,
java.io.FilenameFilter filter,
boolean recurse) |
void |
removeFileListener(HecFile file,
FileListener listener) |
void |
updateFileTime(HecFileImpl file,
long time) |
public static FileManager getFileManager()
public HecFile getFile(java.lang.String path)
FileManagergetFile in interface FileManagerpath - path to the filepublic HecFile getFile(java.lang.String path, boolean createDirIfNeeded)
FileManagergetFile in interface FileManagercreateDirIfNeeded - true to create the directory the file lives in if it doesn't existpublic boolean fileExists(java.lang.String path)
fileExists in interface FileManagerpublic int getFileCount(java.lang.String dirToCount)
getFileCount in interface FileManagerdirToCount - the directory to count the files inpublic java.util.List<java.lang.String> list(java.lang.String directory,
java.io.FilenameFilter filter)
list in interface FileManagerdirectory - directory to get the listing fromfilter - filter to usepublic java.util.List<java.lang.String> list(java.lang.String directory,
java.io.FilenameFilter filter,
boolean recurse)
list in interface FileManagerpublic boolean createDirectory(java.lang.String dirName)
createDirectory in interface FileManagerdirName - the name of the new directorypublic HecFile getUserPreferencesFile(java.lang.String relativePath)
FileManagergetUserPreferencesFile in interface FileManagerstring - com.rma.io.FileManager#getUserPreferencesFile(java.lang.String)public void addFileListener(HecFile file, FileListener listener)
public void removeFileListener(HecFile file, FileListener listener)
public void updateFileTime(HecFileImpl file, long time)
public boolean deleteDirectory(java.io.File path)
deleteDirectory in interface FileManagerpath - the directory to delete