Class AbstractPlexusIoResource
- java.lang.Object
-
- org.codehaus.plexus.components.io.resources.AbstractPlexusIoResource
-
- All Implemented Interfaces:
FileInfo
,ContentSupplier
,NameSupplier
,SizeSupplier
,PlexusIoResource
- Direct Known Subclasses:
PlexusIoFileResource
,PlexusIoURLResource
public abstract class AbstractPlexusIoResource extends Object implements PlexusIoResource
Default implementation ofPlexusIoResource
.
-
-
Field Summary
-
Fields inherited from interface org.codehaus.plexus.components.io.resources.PlexusIoResource
UNKNOWN_MODIFICATION_DATE, UNKNOWN_RESOURCE_SIZE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPlexusIoResource(String name, long lastModified, long size, boolean isFile, boolean isDirectory, boolean isExisting)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getLastModified()
Returns the date, when the resource was last modified, if known.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 theFileInfo
refers to a directory.boolean
isExisting()
Returns, whether the resource exists.boolean
isFile()
Returns, whether theFileInfo
refers to a file.boolean
isSymbolicLink()
Returns, whether theFileInfo
refers to a symlink.-
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
getContents, getURL
-
-
-
-
Method Detail
-
getLastModified
public long getLastModified()
Description copied from interface:PlexusIoResource
Returns the date, when the resource was last modified, if known. Otherwise, returnsPlexusIoResource.UNKNOWN_MODIFICATION_DATE
.- Specified by:
getLastModified
in interfacePlexusIoResource
- See Also:
File.lastModified()
-
getName
@Nonnull public 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 byFile.pathSeparator
- Specified by:
getName
in interfaceFileInfo
- Specified by:
getName
in interfaceNameSupplier
-
getSize
public long getSize()
Description copied from interface:PlexusIoResource
Returns the resources size, if known. Otherwise returnsPlexusIoResource.UNKNOWN_RESOURCE_SIZE
.- Specified by:
getSize
in interfacePlexusIoResource
- Specified by:
getSize
in interfaceSizeSupplier
-
isDirectory
public boolean isDirectory()
Description copied from interface:PlexusIoResource
Returns, whether theFileInfo
refers to a directory.- Specified by:
isDirectory
in interfaceFileInfo
- Specified by:
isDirectory
in interfacePlexusIoResource
-
isExisting
public boolean isExisting()
Description copied from interface:PlexusIoResource
Returns, whether the resource exists.- Specified by:
isExisting
in interfacePlexusIoResource
-
isFile
public boolean isFile()
Description copied from interface:PlexusIoResource
Returns, whether theFileInfo
refers to a file.- Specified by:
isFile
in interfaceFileInfo
- Specified by:
isFile
in interfacePlexusIoResource
-
isSymbolicLink
public boolean isSymbolicLink()
Description copied from interface:FileInfo
Returns, whether theFileInfo
refers to a symlink. This does not necessarily mean that the underlying representation *is* a symlink on disk, but that this resource represents a symlink. This method will return "false" for java versions prior to java7.- Specified by:
isSymbolicLink
in interfaceFileInfo
-
-