|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ibisph.util.IOPath
public abstract class IOPath
Abstract library which provides methods for building consistent file and/or URL paths, getting filenames from end of paths, getting file extensions, getting paths from a path and filename string, and for working with a path separator.
| Constructor Summary | |
|---|---|
IOPath()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
concat(java.lang.String leftSide,
java.lang.String rightSide)
Builds a standardized path based on the File.separator. |
static java.lang.String |
concat(java.lang.String leftSide,
java.lang.String rightSide,
java.lang.String separator)
Builds a standardized path based on the separator passed in. |
static java.lang.String |
createAdjusted(java.lang.String path,
java.lang.String pathType,
java.lang.String contextPath)
Helper that builds a path based on the pathType. |
static java.lang.String |
getFilename(java.lang.String filenameWithPath)
Gets the filename and extension portion of and path and filename source string. |
static java.lang.String |
getFilenameExtension(java.lang.String filename)
Gets only the filename extension - all text past the last file extension character. |
static java.lang.String |
getFilenameExtension(java.lang.String filename,
java.lang.String defaultExtension)
Gets only the filename extension - all text past the last file extension character. |
static java.lang.String |
getFilenameWithoutExtension(java.lang.String filenameWithPathAndExtension)
Gets the filename without any path or extension information. |
static java.lang.String |
getPath(java.lang.String filenameWithPath)
Gets the path portion of filename.extension and path source string. |
static java.lang.String |
getPathAndFilenameWithoutExtension(java.lang.String filenameWithPathAndExtension)
Gets the path and filename sans the extension separator and text that follows the extension. |
static int |
indexOfLastExtensionSeparator(java.lang.String filename)
Gets the last position of the "." filename extension separator. |
static int |
indexOfLastPathSeparator(java.lang.String filename)
Gets the position of the last path separator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IOPath()
| Method Detail |
|---|
public static java.lang.String concat(java.lang.String leftSide,
java.lang.String rightSide,
java.lang.String separator)
File.separator is
used. Before concatenating the paths together, the strings are trimmed
of white space then joined together using the separator.
leftSide - Optional left side of a path.rightSide - Optional right side of a path.separator - Optional path separator to be used to join the left and
and right side strings.
public static java.lang.String concat(java.lang.String leftSide,
java.lang.String rightSide)
File.separator.
leftSide - Optional left side of a path.rightSide - Optional right side of a path.
public static java.lang.String createAdjusted(java.lang.String path,
java.lang.String pathType,
java.lang.String contextPath)
path - Core path.pathType - "F" = path is a file type path, "U" = path is a URL type
path, "C" = context based path so prefix the path with the supplied
contextPath.contextPath - Optional context path prefix.
public static int indexOfLastPathSeparator(java.lang.String filename)
File.separator, the "/" character is checked first
then the "\" character. The reason is that this method is used for
both file and URL based paths. URL paths only use th "/" character
plus with Java's file system the "/" character works just like the
Windows "\" character.
filename - Source string that contains the path/filename to be
searched for.
public static int indexOfLastExtensionSeparator(java.lang.String filename)
filename - Source string that contains the path/filename.ext to be
searched for.
public static java.lang.String getPath(java.lang.String filenameWithPath)
filenameWithPath -
public static java.lang.String getFilename(java.lang.String filenameWithPath)
filenameWithPath -
public static java.lang.String getPathAndFilenameWithoutExtension(java.lang.String filenameWithPathAndExtension)
filenameWithPathAndExtension - Source string that contains the
path/filename.ext to be searched.
public static java.lang.String getFilenameWithoutExtension(java.lang.String filenameWithPathAndExtension)
filenameWithPathAndExtension - Source text to have path and
extension removed from.
public static java.lang.String getFilenameExtension(java.lang.String filename,
java.lang.String defaultExtension)
filename - Source text to find the end extension from. This text
can have path information.defaultExtension - Default extension if one is not found in the
filename passed in.
public static java.lang.String getFilenameExtension(java.lang.String filename)
filename - Source text to find the end extension from. This text
can have path information.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||