|
|
|||||||||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.utilities.FileUtil
public final class FileUtil
Various static helper methods to deal with files and file names.
| Constructor Summary | |
|---|---|
FileUtil()
|
|
| Method Summary | |
|---|---|
static String |
getFilenameExtension(File file)
Returns the lower case extension of the selected file. |
static String |
getFilenameExtension(String name)
Returns the lower case extension of the selected file. |
static File |
locateFile(String name,
String basedir)
Try to locate an file in the filesystem, given a partial name and a prefix. |
static InputStream |
openSystemFile(String filename)
Try to open a file, first trying the file system, then falling back to the classpath. |
static InputStream |
tryGzipInput(InputStream in)
Try to open a stream as gzip, if it starts with the gzip magic. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileUtil()
| Method Detail |
|---|
public static String getFilenameExtension(File file)
null is returned.
file - File object
nullpublic static String getFilenameExtension(String name)
null is returned.
name - File name
null
public static InputStream openSystemFile(String filename)
throws FileNotFoundException
filename - File name in system notation
FileNotFoundException - When no file was found.
public static InputStream tryGzipInput(InputStream in)
throws IOException
in - original input stream
GZIPInputStream if appropriate.
IOException - on IO error
public static File locateFile(String name,
String basedir)
name - file namebasedir - extra base directory to try
null otherwise
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||