|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.starbase.util.FileUtils
Utility class for accessing file info.
| Field Summary | |
static long |
MAX_FILE_LENGTH
Deprecated. StarTeam versions 9.0 and later support long files sizes. |
static long |
MAX_FILE_LENGTH_80
Maximum supported file length in StarTeam 8.0 and earlier. |
| Method Summary | |
static long |
cmp(java.io.File f1,
java.io.File f2)
|
static java.lang.String |
condenseFilePaths(java.lang.String parentFolderPath,
java.lang.String childFolderPath,
boolean caseSensitive,
java.lang.String delimiter)
Compares the two paths and returns a relative path that represents the childFolderPath relative to parentFolderPath or
null if either of the paths passed in are already relative or
invalid, or if childFolderPath cannot be expressed relative to
parentFolderPath. |
static java.lang.String |
condensePath(java.lang.String parentFolderPath,
java.lang.String childFolderPath,
boolean caseSensitive)
Deprecated. |
static java.lang.String |
fullyResolvedPath(java.lang.String name,
java.lang.String pathDelim)
|
static java.lang.String |
getAbsolutePath(java.lang.String path)
Returns the absolute pathname of the given pathname. |
static java.lang.String |
getCanonicalPathName(java.lang.String aPathName,
boolean bCaseSensitive)
|
static int |
getFileLength(java.io.File f)
Deprecated. Use getFileLengthEx, which supports file sizes greater than 2GB. |
static long |
getFileLengthEx(java.io.File f)
Gets the length of the given file. |
static java.lang.String |
getName(java.lang.String path,
java.lang.String pathDelim)
Returns the name of the file represented by this pathname. |
static java.lang.String |
getParent(java.lang.String path,
java.lang.String pathDelim)
Returns the parent part of the given pathname, or null if the name has no parent part. |
static boolean |
isAbsolute(java.lang.String path)
Tests if the given pathname is an absolute pathname. |
static boolean |
isBinary(java.io.File f)
Returns true if the file is considered to be binary. |
static boolean |
match(java.lang.String pattern,
java.lang.String file,
boolean caseSensitive)
|
static boolean |
matchesAnyPattern(java.lang.String filename,
java.lang.String[] patterns,
boolean caseSensitive)
|
static boolean |
matchPatternList(java.lang.String filename,
java.lang.String patternList,
boolean caseSensitive)
|
static java.lang.String[] |
parsePatternList(java.lang.String patternList)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final long MAX_FILE_LENGTH_80
SupportedFeatures.hasLongFileSizes(),
Constant Field Valuespublic static final long MAX_FILE_LENGTH
FileUtils.MAX_FILE_LENGTH_80,
SupportedFeatures.hasLongFileSizes(),
Constant Field Values| Method Detail |
public static long cmp(java.io.File f1,
java.io.File f2)
throws java.io.IOException
java.io.IOException
public static boolean isBinary(java.io.File f)
throws java.io.IOException
java.io.IOException
public static int getFileLength(java.io.File f)
throws java.io.IOException
f - A file whose length is to be determined.
java.io.IOExceptionFileUtils.getFileLengthEx(java.io.File)
public static long getFileLengthEx(java.io.File f)
throws java.io.IOException
f - A file whose length is to be determined.
java.io.IOException
public static boolean matchPatternList(java.lang.String filename,
java.lang.String patternList,
boolean caseSensitive)
public static boolean matchesAnyPattern(java.lang.String filename,
java.lang.String[] patterns,
boolean caseSensitive)
public static java.lang.String[] parsePatternList(java.lang.String patternList)
public static boolean match(java.lang.String pattern,
java.lang.String file,
boolean caseSensitive)
public static final java.lang.String fullyResolvedPath(java.lang.String name,
java.lang.String pathDelim)
public static final java.lang.String getCanonicalPathName(java.lang.String aPathName,
boolean bCaseSensitive)
public static final java.lang.String getParent(java.lang.String path,
java.lang.String pathDelim)
null if the name has no parent part. The parent
part is generally everything leading up to the last occurrence of the
separator character, although the precise definition is system
dependent. On UNIX, for example, the parent part of
"/usr/lib" is "/usr", whose parent part is
"/", which in turn has no parent. On Windows platforms,
the parent part of "c:\java" is "c:\", which
in turn has no parent.
path - A pathname.pathDelim - The path delimiter.
null if the name has no parent part.FileUtils.getName(java.lang.String, java.lang.String)
public static final java.lang.String getName(java.lang.String path,
java.lang.String pathDelim)
path - A pathname.pathDelim - The path delimiter.
FileUtils.getParent(java.lang.String, java.lang.String)public static final boolean isAbsolute(java.lang.String path)
path - A pathname.
true if the pathname indicated by the
File object is an absolute pathname;
false otherwise.public static final java.lang.String getAbsolutePath(java.lang.String path)
The system property user.dir contains the current
user directory.
path - A pathname.
public static final java.lang.String condensePath(java.lang.String parentFolderPath,
java.lang.String childFolderPath,
boolean caseSensitive)
FileUtils.condenseFilePaths(java.lang.String, java.lang.String, boolean, java.lang.String)
public static final java.lang.String condenseFilePaths(java.lang.String parentFolderPath,
java.lang.String childFolderPath,
boolean caseSensitive,
java.lang.String delimiter)
childFolderPath relative to parentFolderPath or
null if either of the paths passed in are already relative or
invalid, or if childFolderPath cannot be expressed relative to
parentFolderPath.
Both c: and \folderName are invalid paths for the purposes of this function.
GetCanonicalPathName is called on boths paths prior to comparison.
This function is essentially Windows-specific, but should work correctly
with at least Unix paths.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||