|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.northwestern.at.utils.FileNameUtils
public class FileNameUtils
File name utilities.
This static class provides various utility methods for manipulating file and directory names.
| Field Summary | |
|---|---|
static MimeTypeMapper |
mimeTypeMapper
Static mime type mapper. |
| Method Summary | |
|---|---|
static boolean |
fileExists(java.lang.String fileName)
Checks if a file exists. |
static java.lang.String |
getContentTypeFor(java.lang.String fileName)
Get MIME type for a filename. |
static java.lang.String |
getFileExtension(java.lang.String fileName,
boolean keepPeriod)
Get file extension from file name. |
static java.lang.String |
stripPathName(java.lang.String fileName)
Strips path from a file name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static MimeTypeMapper mimeTypeMapper
| Method Detail |
|---|
public static java.lang.String stripPathName(java.lang.String fileName)
fileName - File name with possible path.
public static java.lang.String getFileExtension(java.lang.String fileName,
boolean keepPeriod)
fileName - The file name whose extension is wanted.keepPeriod - Keep the period in the extension.
public static java.lang.String getContentTypeFor(java.lang.String fileName)
fileName - Name of file for which mime type is desired.
When the file name's extension is not found in the mime types hash table, a mime type of "application/octet-stream" is returned.
public static boolean fileExists(java.lang.String fileName)
fileName - The file name to check for existence.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||