| Modifier and Type | Field and Description |
|---|---|
| private Boolean | |
| private static final Logger | |
| private final Path | |
| private Path | |
| public static Index | SUPPORTED_SCHEMES
Deprecated
for removal since 12.0.4. Using ResourceFactoryInternals.isSupported() instead.
|
| private final URI |
| Access | Constructor and Description |
|---|---|
| pack-priv | PathResource(URI
the URI to build this PathResource from. uri)Construct a new PathResource from a URI object. |
| pack-priv | |
| pack-priv | |
| pack-priv | PathResource(Path
the Path object path, URI the as-requested URI for the resource uri, boolean true to bypass the allowed schemes check bypassAllowedSchemeCheck)Create a PathResource. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | contains(Resource
the resource other)Overrides org. |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public boolean | exists()
Overrides org. Files#exists(Path, LinkOption. with the following parameters:
getPath() and LinkOption#NOFOLLOW_LINKS.
|
| public String | getFileName()
Implements abstract org. The file name of the resource. |
| public String | getName()
Implements abstract org. |
| public Path | getPath()
Implements abstract org. |
| public Path | |
| public URI | getRealURI()
Overrides org. The real URI of the resource. |
| public URI | getURI()
Implements abstract org. |
| public int | |
| public boolean | |
| public boolean | isDirectory()
Implements abstract org. |
| public boolean | isReadable()
Implements abstract org. |
| public static boolean | |
| public Instant | lastModified()
Overrides org. |
| public long | |
| public List | list()
Overrides org. List of contents of a directory |
| protected Resource | |
| public Resource | resolve(String
the encoded subUriPath subUriPath)Implements abstract org. |
| private void | resolveAlias()
Perform a check of the original Path and as-requested URI to determine if this resource is an alias to another name/location. |
| public String | |
| protected URI |
| alias | back to summary |
|---|---|
| private Boolean alias | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| path | back to summary |
|---|---|
| private final Path path | |
| realPath | back to summary |
|---|---|
| private Path realPath | |
| SUPPORTED_SCHEMES | back to summary |
|---|---|
| public static Index<String> SUPPORTED_SCHEMES
Deprecated for removal since 12.0.4. Using ResourceFactoryInternals.isSupported() instead.
| |
| uri | back to summary |
|---|---|
| private final URI uri | |
| PathResource | back to summary |
|---|---|
| pack-priv PathResource(URI uri) Construct a new PathResource from a URI object.
Must be an absolute URI using the
| |
| PathResource | back to summary |
|---|---|
| pack-priv PathResource(URI uri, boolean bypassAllowedSchemeCheck) | |
| PathResource | back to summary |
|---|---|
| pack-priv PathResource(Path path) | |
| PathResource | back to summary |
|---|---|
| pack-priv PathResource(Path path, URI uri, boolean bypassAllowedSchemeCheck) Create a PathResource. | |
| contains | back to summary |
|---|---|
| public boolean contains(Resource other) Overrides org. Doc from org. Return true if this resource deeply contains the other Resource. This resource must be a directory or a jar file or any form of resource capable of containing other resources. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| exists | back to summary |
|---|---|
| public boolean exists() Overrides org. Doc from org. Equivalent to
| |
| getFileName | back to summary |
|---|---|
| public String getFileName() Implements abstract org. Doc from org. The file name of the resource. This is the last segment of the path. | |
| getName | back to summary |
|---|---|
| public String getName() Implements abstract org. Doc from org. The full name of the resource. | |
| getPath | back to summary |
|---|---|
| public Path getPath() Implements abstract org. Doc from org. Return the Path corresponding to this resource. | |
| getRealPath | back to summary |
|---|---|
| public Path getRealPath() | |
| getRealURI | back to summary |
|---|---|
| public URI getRealURI() Overrides org. Doc from org. The real URI of the resource. If this Resource is an alias, ( | |
| getURI | back to summary |
|---|---|
| public URI getURI() Implements abstract org. Doc from org. URI representing the resource. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isAlias | back to summary |
|---|---|
| public boolean isAlias() Overrides org.
| |
| isDirectory | back to summary |
|---|---|
| public boolean isDirectory() Implements abstract org. Doc from org. Return true if resource represents a directory of potential resources.
| |
| isReadable | back to summary |
|---|---|
| public boolean isReadable() Implements abstract org. Doc from org. True if the resource is readable.
| |
| isSameName | back to summary |
|---|---|
| public static boolean isSameName(Path pathA, Path pathB) Test if the paths are the same name. If the real path is not the same as the absolute path then we know that the real path is the alias for the provided path. For OS's that are case insensitive, this should return the real (on-disk / case correct) version of the path. We have to be careful on Windows and OSX. Assume we have the following scenario:
Path a = new File("foo").toPath();
Files.createFile(a);
Path b = new File("FOO").toPath();
There now exists a file called
| OSX | Windows | Linux
-----------------------+---------+------------+---------
Files.exists(a) | True | True | True
Files.exists(b) | True | True | False
Files.isSameFile(a,b) | True | True | False
a.equals(b) | False | True | False
See the javadoc for Path.equals() for details about this FileSystem behavior difference We also cannot rely on a.compareTo(b) as this is roughly equivalent in implementation to a.equals(b) | |
| lastModified | back to summary |
|---|---|
| public Instant lastModified() Overrides org. Doc from org. The time the resource was last modified.
| |
| length | back to summary |
|---|---|
| public long length() Overrides org. Doc from org. Length of the resource.
| |
| list | back to summary |
|---|---|
| public List Overrides org. Doc from org. List of contents of a directory Ordering is | |
| newResource | back to summary |
|---|---|
| protected Resource newResource(Path path, URI uri) Internal override for creating a new PathResource. Used by MountedPathResource (eg) | |
| resolve | back to summary |
|---|---|
| public Resource resolve(String subUriPath) Implements abstract org. Doc from org. Resolve an existing Resource. | |
| resolveAlias | back to summary | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| private void resolveAlias() Perform a check of the original Path and as-requested URI to determine if this resource is an alias to another name/location.
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| toUri | back to summary |
|---|---|
| protected URI toUri(Path path) Ensure Path to URI is sane when it returns a directory reference.
This is different than | |