public class Path extends Object implements Serializable
Constructor and Description |
---|
Path(String fullPath)
Constructs a new path from the given string path.
|
public Path(String fullPath)
The string path must represent a valid file system path on the local file system.
The path is canonicalized and double slashes are removed except at the beginning. (to handle UNC paths). All forward slashes ('/') are treated as segment delimiters, and any segment and device delimiters for the local file system are also respected (such as colon (':') and backslash ('\') on some file systems).
fullPath
- the string pathisValidPath(String)
public static Path createFromAbsolutePath(String path)
This method does not check the given path - it assumes the path has a valid format of the form "/a/b/c" without duplicate slashes or dots.
public static Path createFromSegments(String[] segments)
public Path addFileExtension(String extension)
public Path addTrailingSeparator()
public String getFileExtension()
public boolean hasTrailingSeparator()
public boolean isAbsolute()
public boolean isEmpty()
public boolean isPrefixOf(Path anotherPath)
public boolean isRoot()
public static boolean isValidPath(String path)
public String lastSegment()
public Path makeAbsolute()
public Path makeRelative()
public int matchingFirstSegments(Path anotherPath)
public Path removeFileExtension()
public Path removeFirstSegments(int count)
public Path removeLastSegments(int count)
public Path removeTrailingSeparator()
public int segmentCount()
public Path uptoSegment(int count)
public static String getFileNameFromPath(String iconPath)
Copyright © 2018 Nuxeo. All rights reserved.