|
IcedTea-Web NetX |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jnlp.util.FileUtils
public final class FileUtils
This class contains a few file-related utility functions.
Constructor Summary | |
---|---|
FileUtils()
|
Method Summary | |
---|---|
static void |
createRestrictedDirectory(java.io.File directory)
Creates a new directory with minimum permissions. |
static void |
createRestrictedFile(java.io.File file,
boolean writableByOwner)
Creates a new file with minimum permissions. |
static java.lang.String |
displayablePath(java.lang.String path)
Returns a String that is suitable for using in GUI elements for displaying (long) paths to users. |
static java.lang.String |
displayablePath(java.lang.String path,
int visibleChars)
Return a String that is suitable for using in GUI elements for displaying paths to users. |
static void |
recursiveDelete(java.io.File file,
java.io.File base)
Recursively delete everything under a directory. |
static java.lang.String |
sanitizeFileName(java.lang.String filename)
Given an input, return a sanitized form of the input suitable for use as a file/directory name |
static java.lang.String |
sanitizePath(java.lang.String path)
Clean up a string by removing characters that can't appear in a local file name. |
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 sanitizePath(java.lang.String path)
path
- the path to sanitize
public static java.lang.String sanitizeFileName(java.lang.String filename)
filename
- the filename to sanitize.
public static void createRestrictedDirectory(java.io.File directory) throws java.io.IOException
java.io.IOException
public static void createRestrictedFile(java.io.File file, boolean writableByOwner) throws java.io.IOException
java.io.IOException
public static java.lang.String displayablePath(java.lang.String path)
path
- a path that should be shortened
public static java.lang.String displayablePath(java.lang.String path, int visibleChars)
path
- a path that should be shortedvisibleChars
- the maximum number of characters that path should fit
into. Also the length of the returned string
public static void recursiveDelete(java.io.File file, java.io.File base) throws java.io.IOException
file
- the file object representing what to delete. Can be either a
file or a directory.base
- the directory under which the file and its subdirectories must be located
java.io.IOException
- on an io exception or if trying to delete something
outside the base
|
IcedTea-Web NetX |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |