|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.universal.io.SmartFile
public class SmartFile
A class for sanitizing Files. Note that the main reason for this class is that on non-Windows, getCanonicalXXX and getAbsoluteXXX might point at different files. If the file is a soft link then the Canonical will be the file that is linked to. The Absolute will be the link file itself. This method will give you the benefits of Canonical -- but will always point at the link file itself. Windows is horribly complex compared to "everything else". Windows does not have the symbolic link issue -- so use getCanonicalXXX to do the work on Windows. Windows will return paths with all forward slashes -- no backward slashes unless it is the special Windows network address that starts with "\\"
I.e. It is just like getAbsoluteXXX -- but it removes all relative path elements from the path.
| Method Summary | |
|---|---|
static File |
sanitize(File f)
Sanitize a File object -- remove all relative path portions, i.e. |
static String |
sanitize(String filename)
Sanitize a path -- remove all relative path portions, i.e. |
static String |
sanitizePaths(String pathsString)
Sanitize a "Classpath-like" list of Paths. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static File sanitize(File f)
f - The file to sanitize
public static String sanitize(String filename)
filename - The path to sanitize
public static String sanitizePaths(String pathsString)
pathsString - A string of paths, each separated by File.pathSeparator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||