public interface PlexusIoResource extends FileInfo, SizeSupplier, ContentSupplier
| Modifier and Type | Field and Description |
|---|---|
static long |
UNKNOWN_MODIFICATION_DATE
Unknown modification date
|
static long |
UNKNOWN_RESOURCE_SIZE
Unknown resource size.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getContents()
Creates an
InputStream, which may be used to read
the files contents. |
long |
getLastModified()
Returns the date, when the resource was last modified, if known.
|
long |
getSize()
Returns the resources size, if known.
|
URL |
getURL()
Returns an
URL, which may be used to reference the
resource, if possible. |
boolean |
isDirectory()
Returns, whether the
FileInfo refers to a directory. |
boolean |
isExisting()
Returns, whether the resource exists.
|
boolean |
isFile()
Returns, whether the
FileInfo refers to a file. |
getName, isSymbolicLinkstatic final long UNKNOWN_RESOURCE_SIZE
static final long UNKNOWN_MODIFICATION_DATE
long getLastModified()
UNKNOWN_MODIFICATION_DATE.File.lastModified()boolean isExisting()
long getSize()
UNKNOWN_RESOURCE_SIZE.getSize in interface SizeSupplierboolean isFile()
FileInfo refers to a file.boolean isDirectory()
FileInfo refers to a directory.isDirectory in interface FileInfo@Nonnull InputStream getContents() throws IOException
InputStream, which may be used to read
the files contents. This is useful, if the file selector
comes to a decision based on the files contents.
Please note that this InputStream is unbuffered. Clients should wrap this in a
BufferedInputStream or attempt reading reasonably large chunks (8K+).getContents in interface ContentSuppliergetContents in interface FileInfoIOExceptionURL getURL() throws IOException
URL, which may be used to reference the
resource, if possible.getContents().IOExceptionCopyright © 2001–2017 Codehaus Plexus. All rights reserved.