|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jut.io.Files
public final class Files
static file utility methods.
Nested Class Summary | |
---|---|
(package private) static interface |
Files.ExtendedInfoSetter
interface used for setExtendedInfoSetter(ExtendedInfoSetter) . |
Method Summary | |
---|---|
static String |
getExtendedInfo(File file)
returns extended information about a file, e.g. access control, hidden status, etc. by default always returns "" if no extended info getter is set using setExtendedInfoGetter(ParamCallable) . |
static File[] |
listFiles(File directory)
returns an array of files contained in the given directory or null if the argument
is not a directory or an I/O error occurs. |
static String |
relPath(File directory,
File file)
returns the relative path of a file within a directory. if the file IS the directory, returns "". for obtaining the paths, simply File.getPath() is called, i.e., the file paths used
in this method are not absolute or canonical. |
static boolean |
setExtendedInfo(File file,
String info)
sets the extended information of file, e.g. access control, hidden status, etc. by default doesn't do anything if no Files.ExtendedInfoSetter is set by
setExtendedInfoSetter(ExtendedInfoSetter) . |
static void |
setExtendedInfoGetter(ParamCallable<String,File> extInfoGetter)
globally set the method for getting extended file information of files used by getExtendedInfo(File) . |
static void |
setExtendedInfoSetter(Files.ExtendedInfoSetter extInfoSetter)
globally set the method for setting extended file information of files used by setExtendedInfo(File, String) . |
static void |
setListFilesHandler(ParamCallable<File[],File> listFilesHandler)
globally set the method for getting the files contained in a directory used by listFiles(File) . by setting a suitable method, e.g. an input speed limit can be
implemented. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static File[] listFiles(File directory)
null
if the argument
is not a directory or an I/O error occurs.
if this method is used consequently, it can be used e.g. to implement an input speed limit.
directory
- - the directory to return the contained files of.
null
if the argument
is not a directory or an I/O error occurs.public static void setListFilesHandler(ParamCallable<File[],File> listFilesHandler)
listFiles(File)
. by setting a suitable method, e.g. an input speed limit can be
implemented.
listFilesHandler
- - the method to use by listFiles(File)
for getting the files
contained in a directory.public static String relPath(File directory, File file) throws IllegalArgumentException
File.getPath()
is called, i.e., the file paths used
in this method are not absolute or canonical.
directory
- - a directory.file
- - the file to get the relative path of.
IllegalArgumentException
- if the file is not contained in the directory.public static String getExtendedInfo(File file)
setExtendedInfoGetter(ParamCallable)
.
file
- - the file to get extended information for.
public static void setExtendedInfoGetter(ParamCallable<String,File> extInfoGetter)
getExtendedInfo(File)
.
extInfoGetter
- - the method to use by getExtendedInfo(File)
for getting extended
file information.public static boolean setExtendedInfo(File file, String info)
Files.ExtendedInfoSetter
is set by
setExtendedInfoSetter(ExtendedInfoSetter)
.
file
- - the file to set extended information for.info
- - the extended information string.
true
if the extended information is set, otherwise false
.public static void setExtendedInfoSetter(Files.ExtendedInfoSetter extInfoSetter)
setExtendedInfo(File, String)
.
extInfoSetter
- - the method to use by setExtendedInfo(File, String)
for setting
extended file information.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |