|
|
|
|
@ -62,7 +62,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -62,7 +62,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new PathResource from a Path handle. |
|
|
|
|
* Create a new {@code PathResource} from a {@link Path} handle. |
|
|
|
|
* <p>Note: Unlike {@link FileSystemResource}, when building relative resources |
|
|
|
|
* via {@link #createRelative}, the relative path will be built <i>underneath</i> |
|
|
|
|
* the given root: e.g. Paths.get("C:/dir1/"), relative path "dir2" → "C:/dir1/dir2"! |
|
|
|
|
@ -74,7 +74,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -74,7 +74,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new PathResource from a Path handle. |
|
|
|
|
* Create a new {@code PathResource} from a path string. |
|
|
|
|
* <p>Note: Unlike {@link FileSystemResource}, when building relative resources |
|
|
|
|
* via {@link #createRelative}, the relative path will be built <i>underneath</i> |
|
|
|
|
* the given root: e.g. Paths.get("C:/dir1/"), relative path "dir2" → "C:/dir1/dir2"! |
|
|
|
|
@ -87,7 +87,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -87,7 +87,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a new PathResource from a Path handle. |
|
|
|
|
* Create a new {@code PathResource} from a {@link URI}. |
|
|
|
|
* <p>Note: Unlike {@link FileSystemResource}, when building relative resources |
|
|
|
|
* via {@link #createRelative}, the relative path will be built <i>underneath</i> |
|
|
|
|
* the given root: e.g. Paths.get("C:/dir1/"), relative path "dir2" → "C:/dir1/dir2"! |
|
|
|
|
@ -128,7 +128,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -128,7 +128,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This implementation opens a InputStream for the underlying file. |
|
|
|
|
* This implementation opens an {@link InputStream} for the underlying file. |
|
|
|
|
* @see java.nio.file.spi.FileSystemProvider#newInputStream(Path, OpenOption...) |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@ -174,7 +174,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -174,7 +174,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This implementation opens a OutputStream for the underlying file. |
|
|
|
|
* This implementation opens an {@link OutputStream} for the underlying file. |
|
|
|
|
* @see java.nio.file.spi.FileSystemProvider#newOutputStream(Path, OpenOption...) |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@ -186,7 +186,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -186,7 +186,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This implementation returns a URL for the underlying file. |
|
|
|
|
* This implementation returns a {@link URL} for the underlying file. |
|
|
|
|
* @see java.nio.file.Path#toUri() |
|
|
|
|
* @see java.net.URI#toURL() |
|
|
|
|
*/ |
|
|
|
|
@ -196,7 +196,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -196,7 +196,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This implementation returns a URI for the underlying file. |
|
|
|
|
* This implementation returns a {@link URI} for the underlying file. |
|
|
|
|
* @see java.nio.file.Path#toUri() |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@ -213,7 +213,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -213,7 +213,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This implementation returns the underlying File reference. |
|
|
|
|
* This implementation returns the underlying {@link File} reference. |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public File getFile() throws IOException { |
|
|
|
|
@ -228,7 +228,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -228,7 +228,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This implementation opens a Channel for the underlying file. |
|
|
|
|
* This implementation opens a {@link ReadableByteChannel} for the underlying file. |
|
|
|
|
* @see Files#newByteChannel(Path, OpenOption...) |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@ -242,7 +242,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -242,7 +242,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This implementation opens a Channel for the underlying file. |
|
|
|
|
* This implementation opens a {@link WritableByteChannel} for the underlying file. |
|
|
|
|
* @see Files#newByteChannel(Path, OpenOption...) |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@ -259,7 +259,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -259,7 +259,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This implementation returns the underlying File's timestamp. |
|
|
|
|
* This implementation returns the underlying file's timestamp. |
|
|
|
|
* @see java.nio.file.Files#getLastModifiedTime(Path, java.nio.file.LinkOption...) |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@ -270,7 +270,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -270,7 +270,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This implementation creates a PathResource, applying the given path |
|
|
|
|
* This implementation creates a {@link PathResource}, applying the given path |
|
|
|
|
* relative to the path of the underlying file of this resource descriptor. |
|
|
|
|
* @see java.nio.file.Path#resolve(String) |
|
|
|
|
*/ |
|
|
|
|
@ -295,7 +295,7 @@ public class PathResource extends AbstractResource implements WritableResource {
@@ -295,7 +295,7 @@ public class PathResource extends AbstractResource implements WritableResource {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This implementation compares the underlying Path references. |
|
|
|
|
* This implementation compares the underlying {@link Path} references. |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public boolean equals(@Nullable Object obj) { |
|
|
|
|
|