@CodeReview(reviewer="Jonathan McClain", date="2006-05-11", changesNeeded=false, comments="No changes necessary.") public final class FileUtil extends java.lang.Object
FileUtil class defines some useful utilities for dealing
with files.| Constructor and Description |
|---|
FileUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
couldWrite(java.io.File file)
Attempts to determine if the application might be able to write to the
given file, which may or may not already exists.
|
static java.lang.String |
getExtension(java.io.File file)
Returns the extension of the given file, which is the part of the name
after the last '.'.
|
static java.lang.String |
getExtension(java.lang.String fileName)
Returns the extension of the given filename , which is the part of the
name after the last '.'.
|
static java.lang.String |
removeExtension(java.lang.String fileName)
Takes a file name and returns the name of the file without the extension
on it.
|
public static java.lang.String getExtension(java.io.File file)
file - The File to get the extension from.public static java.lang.String getExtension(java.lang.String fileName)
fileName - The file name to get the extension from.public static java.lang.String removeExtension(java.lang.String fileName)
fileName - A file name.public static boolean couldWrite(java.io.File file)
file - The file (which may or may not already exist) to see if it can be
written to.