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, isSymbolicLink
static 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 SizeSupplier
boolean 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 ContentSupplier
getContents
in interface FileInfo
IOException
URL getURL() throws IOException
URL
, which may be used to reference the
resource, if possible.getContents()
.IOException
Copyright © 2001-2014 Codehaus. All Rights Reserved.