Url
is what defines a path to a page, a binary resource or an action in the system.
A virtual path made up of PathElements. A path can be specified as an array of PathElements where each PathElement specifies the sub-element of the parent path.
To use an empty path, use the public static constant {@link #empty}, there is no other way to instantiate an empty path.
@author Mark Bednarczyk @author Sly Technologies, Inc.The path is independent of any particular proxy instances. This means that even if the model is stored and reloaded and the proxies discarded and new ones created that it can be used to locate the proxy associated with the same model object as the proxy for which it was created.
A {@code Path} represents a path that is hierarchical and composed of asequence of directory and file name elements separated by a special separator or delimiter. A root component, that identifies a file system hierarchy, may also be present. The name element that is farthest from the root of the directory hierarchy is the name of a file or directory. The other name elements are directory names. A {@code Path} can represent aroot, a root and a sequence of names, or simply one or more name elements. A {@code Path} is considered to be an empty path if it consistssolely of one name element that is empty. Accessing a file using an empty path is equivalent to accessing the default directory of the file system. {@code Path} defines the {@link #getFileName() getFileName}, {@link #getParent getParent}, {@link #getRoot getRoot}, and {@link #subpath subpath} methods to access the path components or a subsequence of its nameelements.
In addition to accessing the components of a path, a {@code Path} alsodefines the {@link #resolve(Path) resolve} and {@link #resolveSibling(Path) resolveSibling} methods to combine paths. The {@link #relativize relativize}method that can be used to construct a relative path between two paths. Paths can be {@link #compareTo compared}, and tested against each other using the {@link #startsWith startsWith} and {@link #endsWith endsWith} methods.
This interface extends {@link Watchable} interface so that a directorylocated by a path can be {@link #register registered} with a {@link WatchService} and entries in the directory watched.
WARNING: This interface is only intended to be implemented by those developing custom file system implementations. Methods may be added to this interface in future releases.
Paths may be used with the {@link Files} class to operate on files,directories, and other types of files. For example, suppose we want a {@link java.io.BufferedReader} to read text from a file "{@code access.log}". The file is located in a directory " {@code logs}" relative to the current working directory and is UTF-8 encoded.
Path path = FileSystems.getDefault().getPath("logs", "access.log"); BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8);
Paths associated with the default {@link java.nio.file.spi.FileSystemProvider provider} are generally interoperablewith the {@link java.io.File java.io.File} class. Paths created by otherproviders are unlikely to be interoperable with the abstract path names represented by {@code java.io.File}. The {@link java.io.File#toPath toPath}method may be used to obtain a {@code Path} from the abstract path namerepresented by a {@code java.io.File} object. The resulting {@code Path} canbe used to operate on the same file as the {@code java.io.File} object. Inaddition, the {@link #toFile toFile} method is useful to construct a {@code File} from the {@code String} representation of a {@code Path}.
Implementations of this interface are immutable and safe for use by multiple concurrent threads. @since 1.7 @see Paths
Node
. The path corresponds to the succession of nodes in the order they are returned by the Iterator
@author Emmanuel Bernard
Path
utility class provides misc. methods to resolve and nornalize JCR-style item paths. Each path consistnes of path elements and is immutable. It has the following properties: isAbsolute()
:isNormalized()
:isCanonical()
:path ::= properpath ['/'] properpath ::= abspath | relpath abspath ::= '/' relpath relpath ::= pathelement | relpath '/' pathelement pathelement ::= name | name '[' number ']' | '..' | '.' number ::= (* An integer > 0 *) name ::= simplename | prefixedname simplename ::= onecharsimplename | twocharsimplename | threeormorecharname prefixedname ::= prefix ':' localname localname ::= onecharlocalname | twocharlocalname | threeormorecharname onecharsimplename ::= (* Any Unicode character except: '.', '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character *) twocharsimplename ::= '.' onecharsimplename | onecharsimplename '.' | onecharsimplename onecharsimplename onecharlocalname ::= nonspace twocharlocalname ::= nonspace nonspace threeormorecharname ::= nonspace string nonspace prefix ::= (* Any valid XML Name *) string ::= char | string char char ::= nonspace | ' ' nonspace ::= (* Any Unicode character except: '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character *)
Path
interface defines the qualified representation of a JCR path. It consists of an ordered list of {@link Path.Element} objectsand is immutable. A {@link Path.Element} is either {@link Path.Element#denotesName() named}or one of the following special elements: Path
is defined to have the following characteristics: Equality:The Path object is used to standard used to standardize the creation of mutation of path-like structures. For: example /foo/bar/index.html.
Below are the rules for how the constructor interprets literal paths. NOTE the {@link addSegment(String)} interprets stringpathes in a somewhat different manner.
Literal Path | Interpretation | /foo/bar/index.html | foo and bar will be considered directory segments while index.html will be considered a file segment. This means that the baseName will be set to index and the fileExtension will be set to .html |
---|---|
/foo/bar/, /foo/bar, foo/bar/ foo/bar | I cases where a file has no extension you must use the {@link setFileSegment(String))} to manually set the file. This causes the |
@version $Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/ui/path/Path.java#0 $) $Date: 10-nov-2005.18:50:28 $ @author The Oracle ADF Faces Team
String[] onProvideCompletionsFromMyField(String input) { return . . .; }
<sometask>
<somepath>
<pathelement location="/path/to/file.jar" />
<pathelement path="/path/to/file2.jar:/path/to/class2;/path/to/class3" />
<pathelement location="/path/to/file3.jar" />
<pathelement location="/path/to/file4.jar" />
</somepath>
</sometask>
The object implemention sometask
must provide a method called createSomepath
which returns an instance of Path
. Nested path definitions are handled by the Path object and must be labeled pathelement
.
The path element takes a parameter path
which will be parsed and split into single elements. It will usually be used to define a path from an environment variable.
Iterator
pattern, providing one-time access to the specific steps that form a path in a hierarchical structure. /
separator.The {@link Path} class provides various operations that can be performed on such a string of segments. Path isimmutable.
@author igor.vaynberg
IPath
interface. Paths are always maintained in canonicalized form. That is, parent references (i.e., ../../
) and duplicate separators are resolved. For example, new Path("/a/b").append("../foo/bar")will yield the path
/a/foo/bar
This class can be used without OSGi running.
This class is not intended to be subclassed by clients but may be instantiated.
@see IPath @noextend This class is not intended to be subclassed by clients.Path
interface. Paths are always maintained in canonicalized form. That is, parent references (i.e., ../../
) and duplicate separators are resolved. For example, new Path("/a/b").append("../foo/bar")will yield the path
/a/foo/bar@author IBM @author Konstantin Komissarchik
This class simplifies working with paths and using a Path
is often more efficient that processing and manipulating the equivalent String
. This class can easily {@link #iterator() iterate} over the segments, returnthe {@link #size() number of segments}, {@link #compareTo(Path) compare} with other paths, {@link #resolve(Path) resolve}relative paths, return the {@link #getParent() ancestor (or parent)}, determine whether one path is an {@link #isAncestorOf(Path) ancestor} or {@link #isDecendantOf(Path) decendent} of another path, and{@link #getCommonAncestor(Path) finding a common ancestor}.
Comparable
, the natural ordering of Path
s is: Property
elements, in List order. If two Paths are equal up until the end of one of them, the path that ends (when the other does not) is considered to be first in the ordering. INTENDED FOR DIRECT IMPLEMENTATION
@author Bill Blondeau
Path
can be created from any object. When you call a constructor, the path is initialized as empty, then the objects passed to the constructor are added to it. When all objects have been added, the path is simplified by removing redundant elements. For example, "home/user/../otheruser" is reduced to "home/otheruser". After the constructor returns, the Path
object is immutable. When you call a method to modify it (like one of the add()
methods), it returns a new Path
that is the result of the requested operation. The objects are added as follows: Path
, its elements are added;String
, it is split in tokens (divided by slashes or backslashes) and these tokens are added as elements;Collection
, any member of the Collection
is added as a separate object;String
s, any member of the array is added as a separate String
(to be tokenized);toString()
method is called and the returned String
is tokenized and added. This class simplifies working with paths and using a Path
is often more efficient that processing and manipulating the equivalent String
. This class can easily {@link #iterator() iterate} over the segments, returnthe {@link #size() number of segments}, {@link #compareTo(Path) compare} with other paths, {@link #resolve(Path) resolve}relative paths, return the {@link #getParent() ancestor (or parent)}, determine whether one path is an {@link #isAncestorOf(Path) ancestor} or {@link #isDescendantOf(Path) decendent} of another path, and{@link #getCommonAncestor(Path) finding a common ancestor}.
Path
represents the path part of a URI. This provides the various components of the URI path to the user. The normalization of the path is the conversion of the path given into it's actual path by removing the references to the parent directories and to the current dir. If the path that this represents is /usr/bin/../etc/./README
then the actual path, normalized, is /usr/etc/README
. Once the path has been normalized it is possible to acquire the segments as an array of strings, which allows simple manipulation of the path.
@author Niall Gallagher
@see org.simpleframework.http.parse.PathParser
The code below creates a path drawing a 100 x 100 pixels rectangle at the position (50, 50):
Path path = new Path(50, 50); path.lineRelativelyTo(100, 0); path.lineRelativelyTo(0, 100); path.lineRelativelyTo(-100, 0); path.close();This rectangle is modified as a triangle with the following code:
path.setStep(2, new LineTo(true, -50, 100)); path.removeStep(3);@author Henri Kerola / IT Mill Ltd
The following features are supported:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|