|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.plexus.components.io.resources.AbstractPlexusIoResource
org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceWithAttributes
org.codehaus.plexus.components.io.resources.PlexusIoFileResource
public class PlexusIoFileResource
Implementation of PlexusIoResource
for files.
Field Summary |
---|
Fields inherited from interface org.codehaus.plexus.components.io.resources.PlexusIoResource |
---|
UNKNOWN_MODIFICATION_DATE, UNKNOWN_RESOURCE_SIZE |
Constructor Summary | |
---|---|
PlexusIoFileResource()
Creates a new instance. |
|
PlexusIoFileResource(java.io.File file)
Creates a new instance. |
|
PlexusIoFileResource(java.io.File file,
PlexusIoResourceAttributes attrs)
Creates a new instance. |
|
PlexusIoFileResource(java.io.File file,
java.lang.String name)
Creates a new instance. |
|
PlexusIoFileResource(java.io.File file,
java.lang.String name,
PlexusIoResourceAttributes attrs)
|
Method Summary | |
---|---|
java.io.InputStream |
getContents()
Creates an InputStream , which may be used to read
the files contents. |
java.io.File |
getFile()
Returns the resources file. |
long |
getLastModified()
Returns the date, when the resource was last modified, if known. |
long |
getSize()
Returns the resources size, if known. |
java.net.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. |
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 |
setFile(java.io.File file)
Sets the resources file. |
void |
setLastModified(long lastModified)
Sets the date, when the resource was last modified. |
void |
setSize(long size)
Sets the resources size. |
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, setName |
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.PlexusIoResourceWithAttributes |
---|
getAttributes, setAttributes |
Methods inherited from interface org.codehaus.plexus.components.io.fileselectors.FileInfo |
---|
getName |
Constructor Detail |
---|
public PlexusIoFileResource()
public PlexusIoFileResource(java.io.File file)
public PlexusIoFileResource(java.io.File file, PlexusIoResourceAttributes attrs)
public PlexusIoFileResource(java.io.File file, java.lang.String name)
public PlexusIoFileResource(java.io.File file, java.lang.String name, PlexusIoResourceAttributes attrs)
Method Detail |
---|
public void setFile(java.io.File file)
public java.io.File getFile()
public java.io.InputStream getContents() throws java.io.IOException
FileInfo
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.
getContents
in interface FileInfo
java.io.IOException
public java.net.URL getURL() throws java.io.IOException
PlexusIoResource
URL
, which may be used to reference the
resource, if possible.
getURL
in interface PlexusIoResource
#getInputStream()
.
java.io.IOException
public long getLastModified()
PlexusIoResource
PlexusIoResource.UNKNOWN_MODIFICATION_DATE
.
getLastModified
in interface PlexusIoResource
getLastModified
in class AbstractPlexusIoResource
File.lastModified()
public long getSize()
PlexusIoResource
PlexusIoResource.UNKNOWN_RESOURCE_SIZE
.
getSize
in interface PlexusIoResource
getSize
in class AbstractPlexusIoResource
public boolean isDirectory()
FileInfo
FileInfo
refers to a directory.
isDirectory
in interface FileInfo
isDirectory
in class AbstractPlexusIoResource
public boolean isExisting()
PlexusIoResource
isExisting
in interface PlexusIoResource
isExisting
in class AbstractPlexusIoResource
public boolean isFile()
FileInfo
FileInfo
refers to a file.
isFile
in interface FileInfo
isFile
in class AbstractPlexusIoResource
public void setDirectory(boolean isDirectory)
AbstractPlexusIoResource
setDirectory
in class AbstractPlexusIoResource
public void setExisting(boolean isExisting)
AbstractPlexusIoResource
setExisting
in class AbstractPlexusIoResource
public void setFile(boolean isFile)
AbstractPlexusIoResource
setFile
in class AbstractPlexusIoResource
public void setLastModified(long lastModified)
AbstractPlexusIoResource
setLastModified
in class AbstractPlexusIoResource
File.lastModified()
public void setSize(long size)
AbstractPlexusIoResource
setSize
in class AbstractPlexusIoResource
size
- The resources size, if known. Otherwise returns
PlexusIoResource.UNKNOWN_RESOURCE_SIZE
.File.length()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |