Path.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | MAP_THRESHOLD
Only allow cached mapping when the resource is very large. |
| private MappedByteBuffer | |
| private final Path | |
| private URL |
| Access | Constructor and Description |
|---|---|
| public | PathResource(final String
the relative path name (must not be pathName, final Path null)the path (must not be path)null)Construct a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuffer | asBuffer()
Overrides io. Returns the bytes of this resource, as a read-only byte buffer. |
| public String | asString(final Charset
the character set to use for decoding (must not be charset)null)Overrides io. Returns the resource content as a string. |
| public boolean | isDirectory()
Overrides io. Returns true if this resource represents a directory, or false otherwise. |
| public Instant | modifiedTime()
Overrides io. Returns the modification time of the resource, or |
| public DirectoryStream | openDirectoryStream()
Overrides io. Open a directory stream to read the contents of this directory. |
| public InputStream | openStream()
Implements abstract io. Open an input stream to read this resource. |
| public Path | |
| public long | size()
Implements abstract io. Returns the size of the resource, or |
| public URL | url()
Implements abstract io. Returns the resource URL (not |
| MAP_THRESHOLD | back to summary |
|---|---|
| private static final long MAP_THRESHOLD Only allow cached mapping when the resource is very large. | |
| mapped | back to summary |
|---|---|
| private MappedByteBuffer mapped | |
| path | back to summary |
|---|---|
| private final Path path | |
| url | back to summary |
|---|---|
| private URL url | |
| PathResource | back to summary |
|---|---|
| public PathResource(final String pathName, final Path path) Construct a new instance. | |
| asBuffer | back to summary |
|---|---|
| public ByteBuffer asBuffer() throws IOException Overrides io. Doc from io. Returns the bytes of this resource, as a read-only byte buffer.
The buffer is suitable for passing to
| |
| asString | back to summary |
|---|---|
| public String asString(final Charset charset) throws IOException Overrides io. Doc from io. Returns the resource content as a string.
| |
| isDirectory | back to summary |
|---|---|
| public boolean isDirectory() Overrides io. Doc from io. Returns true if this resource represents a directory, or false otherwise. Not every resource implementation supports directory access.
| |
| modifiedTime | back to summary |
|---|---|
| public Instant modifiedTime() Overrides io. Doc from io. Returns the modification time of the resource, or
| |
| openDirectoryStream | back to summary |
|---|---|
| public DirectoryStream Overrides io. Doc from io. Open a directory stream to read the contents of this directory. Not every resource implementation supports directory access.
| |
| openStream | back to summary |
|---|---|
| public InputStream openStream() throws IOException Implements abstract io. Doc from io. Open an input stream to read this resource.
| |
| path | back to summary |
|---|---|
| public Path path() Returns the path of this resource.
| |
| size | back to summary |
|---|---|
| public long size() Implements abstract io. Doc from io. Returns the size of the resource, or
| |
| url | back to summary |
|---|---|
| public URL url() Implements abstract io. Doc from io. Returns the resource URL (not
| |