|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.bioquery.bqutils.FileUtils
Simple file utilities for working with the bioquery file system.
The
bioquery file system represents filenames as a path starting with the
file separator (specific to the platform of the SERVER, that is '/' for
unix, '\' for windows, etc.), followed by the name of the user directory,
and then the path the file. If the path
points to a directory, it will end with a file separator, if it points to
a file, there will be no file separator after the filename:
/username/queries/subDirectory/aDirectory/
/username/queries/subDirectory/aFile
| Constructor Summary | |
FileUtils()
|
|
| Method Summary | |
static java.lang.String |
getFileExtension(java.lang.String fileName)
Returns the file extension for the given filename or path. |
static java.lang.String |
getFileName(java.lang.String filePath)
Pulls the filename off the end of a full path and returns. |
static java.lang.String |
getFileSeparator(java.lang.String path)
Returns the file separator used by this path on this server. |
static java.lang.String[] |
getPath(java.lang.String path)
This method takes a path String representing a file or directory and puts each file or directory name into a String array, discarding all of the File.separators. |
static java.lang.String |
getPathString(java.lang.String path)
Strips the filename off the end of the path String and returns. |
static boolean |
isDirectory(java.lang.String path)
Takes a path String representing a file on the server and determines whether it is a file or directory. |
static java.lang.String |
stripFileExtension(java.lang.String fileName)
Removes the file extension from a filename or full path, including the final period (.). |
static java.lang.String |
stripFirstDirFromPath(java.lang.String path)
Removes the first directory from the given path. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FileUtils()
| Method Detail |
public static java.lang.String getFileSeparator(java.lang.String path)
/username/queries/filenamepath - a path String representing a file on the server.public static java.lang.String[] getPath(java.lang.String path)
path - a path String representing a file on the server.public static java.lang.String getPathString(java.lang.String path)
public static java.lang.String getFileName(java.lang.String filePath)
filePath - the path to a file on the serverpublic static java.lang.String getFileExtension(java.lang.String fileName)
fileName - a filename or full pathpublic static java.lang.String stripFileExtension(java.lang.String fileName)
fileName - any filename or pathnamepublic static boolean isDirectory(java.lang.String path)
/username/queries/nameis a file, while
/username/queries/name/ is a directory.path - a path String representing a file on the server.public static java.lang.String stripFirstDirFromPath(java.lang.String path)
path - path to a file on the server
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||