org.codehaus.plexus.components.io.resources
Interface PlexusIoResource

All Superinterfaces:
FileInfo
All Known Subinterfaces:
PlexusIoResourceWithAttributes
All Known Implementing Classes:
AbstractPlexusIoResource, AbstractPlexusIoResourceWithAttributes, PlexusIoFileResource, PlexusIoProxyResource, PlexusIoProxyResourceWithAttributes, PlexusIoURLResource

public interface PlexusIoResource
extends FileInfo

A resource is a file-like entity. It may be an actual file, an URL, a zip entry, or something like that.


Field Summary
static long UNKNOWN_MODIFICATION_DATE
          Unknown modification date
static long UNKNOWN_RESOURCE_SIZE
          Unknown resource size.
 
Method Summary
 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 isExisting()
          Returns, whether the resource exists.
 
Methods inherited from interface org.codehaus.plexus.components.io.fileselectors.FileInfo
getContents, getName, isDirectory, isFile
 

Field Detail

UNKNOWN_RESOURCE_SIZE

static final long UNKNOWN_RESOURCE_SIZE
Unknown resource size.

See Also:
Constant Field Values

UNKNOWN_MODIFICATION_DATE

static final long UNKNOWN_MODIFICATION_DATE
Unknown modification date

See Also:
Constant Field Values
Method Detail

getLastModified

long getLastModified()
Returns the date, when the resource was last modified, if known. Otherwise, returns UNKNOWN_MODIFICATION_DATE.

See Also:
File.lastModified()

isExisting

boolean isExisting()
Returns, whether the resource exists.


getSize

long getSize()
Returns the resources size, if known. Otherwise returns UNKNOWN_RESOURCE_SIZE.


getURL

URL getURL()
           throws IOException
Returns an URL, which may be used to reference the resource, if possible.

Returns:
An URL referencing the resource, if possible, or null. In the latter case, you are forced to use #getInputStream().
Throws:
IOException


Copyright © 2001-2011 Codehaus. All Rights Reserved.