org.codehaus.plexus.components.io.resources
Class AbstractPlexusIoResource

java.lang.Object
  extended by org.codehaus.plexus.components.io.resources.AbstractPlexusIoResource
All Implemented Interfaces:
FileInfo, PlexusIoResource
Direct Known Subclasses:
AbstractPlexusIoResourceWithAttributes, PlexusIoProxyResource, PlexusIoURLResource

public abstract class AbstractPlexusIoResource
extends java.lang.Object
implements PlexusIoResource

Default implementation of PlexusIoResource.


Field Summary
 
Fields inherited from interface org.codehaus.plexus.components.io.resources.PlexusIoResource
UNKNOWN_MODIFICATION_DATE, UNKNOWN_RESOURCE_SIZE
 
Constructor Summary
AbstractPlexusIoResource()
          Creates a new instance with default settings.
 
Method Summary
 long getLastModified()
          Returns the date, when the resource was last modified, if known.
 java.lang.String getName()
          Returns the resources name, which may include path components, like directory names, or something like that.
 long getSize()
          Returns the resources size, if known.
 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.
 void setDirectory(boolean isDirectory)
          Sets, whether the resource is a directory.
 void setExisting(boolean isExisting)
          Sets, whether the resource exists.
 void setFile(boolean isFile)
          Sets, whether the resource is a file.
 void setLastModified(long lastModified)
          Sets the date, when the resource was last modified.
 void setName(java.lang.String name)
          Sets the resources name, which may include path components, like directory names, or something like that.
 void setSize(long size)
          Sets the resources size.
 
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.resources.PlexusIoResource
getURL
 
Methods inherited from interface org.codehaus.plexus.components.io.fileselectors.FileInfo
getContents
 

Constructor Detail

AbstractPlexusIoResource

public AbstractPlexusIoResource()
Creates a new instance with default settings.

Method Detail

setLastModified

public void setLastModified(long lastModified)
Sets the date, when the resource was last modified.

Parameters:
Date - of last modification, if known. Otherwise, PlexusIoResource.UNKNOWN_MODIFICATION_DATE.
See Also:
File.lastModified()

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
See Also:
File.lastModified()

setName

public void setName(java.lang.String name)
Sets the resources name, which may include path components, like directory names, or something like that. The resources name is expected to be a relative name and the path components must be separated by File.pathSeparator


getName

public java.lang.String getName()
Description copied from interface: FileInfo
Returns the resources name, which may include path components, like directory names, or something like that. The resources name is expected to be a relative name and the path components must be separated by File.pathSeparator

Specified by:
getName in interface FileInfo

setSize

public void setSize(long size)
Sets the resources size.

Parameters:
size - The resources size, if known. Otherwise returns PlexusIoResource.UNKNOWN_RESOURCE_SIZE.
See Also:
File.length()

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

setDirectory

public void setDirectory(boolean isDirectory)
Sets, whether the resource is a directory.


isDirectory

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

Specified by:
isDirectory in interface FileInfo

setExisting

public void setExisting(boolean isExisting)
Sets, whether the resource exists.


isExisting

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

Specified by:
isExisting in interface PlexusIoResource

setFile

public void setFile(boolean isFile)
Sets, whether the resource is a file.


isFile

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

Specified by:
isFile in interface FileInfo


Copyright © 2001-2009 Codehaus. All Rights Reserved.