org.codehaus.plexus.components.io.resources.proxy
Class PlexusIoProxyResourceWithAttributes

java.lang.Object
  extended by org.codehaus.plexus.components.io.resources.AbstractPlexusIoResource
      extended by org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceWithAttributes
          extended by org.codehaus.plexus.components.io.resources.proxy.PlexusIoProxyResourceWithAttributes
All Implemented Interfaces:
FileInfo, PlexusIoResource, PlexusIoResourceWithAttributes

public class PlexusIoProxyResourceWithAttributes
extends AbstractPlexusIoResourceWithAttributes


Field Summary
 
Fields inherited from interface org.codehaus.plexus.components.io.resources.PlexusIoResource
UNKNOWN_MODIFICATION_DATE, UNKNOWN_RESOURCE_SIZE
 
Constructor Summary
PlexusIoProxyResourceWithAttributes(PlexusIoResource plexusIoResource, PlexusIoResourceAttributes attrs)
           
PlexusIoProxyResourceWithAttributes(PlexusIoResourceWithAttributes plexusIoResource)
           
 
Method Summary
 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.
 
Methods inherited from class org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceWithAttributes
getAttributes, setAttributes
 
Methods inherited from class org.codehaus.plexus.components.io.resources.AbstractPlexusIoResource
getName, setDirectory, setExisting, setFile, setLastModified, setName, setSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.plexus.components.io.fileselectors.FileInfo
getName
 

Constructor Detail

PlexusIoProxyResourceWithAttributes

public PlexusIoProxyResourceWithAttributes(PlexusIoResourceWithAttributes plexusIoResource)

PlexusIoProxyResourceWithAttributes

public PlexusIoProxyResourceWithAttributes(PlexusIoResource plexusIoResource,
                                           PlexusIoResourceAttributes attrs)
Method Detail

getLastModified

public long getLastModified()
Description copied from interface: PlexusIoResource
Returns the date, when the resource was last modified, if known. Otherwise, returns PlexusIoResource.UNKNOWN_MODIFICATION_DATE.

Specified by:
getLastModified in interface PlexusIoResource
Overrides:
getLastModified in class AbstractPlexusIoResource
See Also:
File.lastModified()

getSize

public long getSize()
Description copied from interface: PlexusIoResource
Returns the resources size, if known. Otherwise returns PlexusIoResource.UNKNOWN_RESOURCE_SIZE.

Specified by:
getSize in interface PlexusIoResource
Overrides:
getSize in class AbstractPlexusIoResource

isDirectory

public boolean isDirectory()
Description copied from interface: FileInfo
Returns, whether the FileInfo refers to a directory.

Specified by:
isDirectory in interface FileInfo
Overrides:
isDirectory in class AbstractPlexusIoResource

isExisting

public boolean isExisting()
Description copied from interface: PlexusIoResource
Returns, whether the resource exists.

Specified by:
isExisting in interface PlexusIoResource
Overrides:
isExisting in class AbstractPlexusIoResource

isFile

public boolean isFile()
Description copied from interface: FileInfo
Returns, whether the FileInfo refers to a file.

Specified by:
isFile in interface FileInfo
Overrides:
isFile in class AbstractPlexusIoResource

getURL

public URL getURL()
           throws IOException
Description copied from interface: PlexusIoResource
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

getContents

public InputStream getContents()
                        throws IOException
Description copied from interface: FileInfo
Creates an 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.

Throws:
IOException


Copyright © 2001-2012 Codehaus. All Rights Reserved.