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 protectedAbstractPlexusIoResource(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 longgetLastModified()Returns the date, when the resource was last modified, if known.StringgetName()Returns the resources name, which may include path components, like directory names, or something like that.longgetSize()Returns the resources size, if known.booleanisDirectory()Returns, whether theFileInforefers to a directory.booleanisExisting()Returns, whether the resource exists.booleanisFile()Returns, whether theFileInforefers to a file.booleanisSymbolicLink()Returns, whether theFileInforefers 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:PlexusIoResourceReturns the date, when the resource was last modified, if known. Otherwise, returnsPlexusIoResource.UNKNOWN_MODIFICATION_DATE.- Specified by:
getLastModifiedin interfacePlexusIoResource- See Also:
File.lastModified()
-
getName
@Nonnull public String getName()
Description copied from interface:FileInfoReturns 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:
getNamein interfaceFileInfo- Specified by:
getNamein interfaceNameSupplier
-
getSize
public long getSize()
Description copied from interface:PlexusIoResourceReturns the resources size, if known. Otherwise returnsPlexusIoResource.UNKNOWN_RESOURCE_SIZE.- Specified by:
getSizein interfacePlexusIoResource- Specified by:
getSizein interfaceSizeSupplier
-
isDirectory
public boolean isDirectory()
Description copied from interface:PlexusIoResourceReturns, whether theFileInforefers to a directory.- Specified by:
isDirectoryin interfaceFileInfo- Specified by:
isDirectoryin interfacePlexusIoResource
-
isExisting
public boolean isExisting()
Description copied from interface:PlexusIoResourceReturns, whether the resource exists.- Specified by:
isExistingin interfacePlexusIoResource
-
isFile
public boolean isFile()
Description copied from interface:PlexusIoResourceReturns, whether theFileInforefers to a file.- Specified by:
isFilein interfaceFileInfo- Specified by:
isFilein interfacePlexusIoResource
-
isSymbolicLink
public boolean isSymbolicLink()
Description copied from interface:FileInfoReturns, whether theFileInforefers 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:
isSymbolicLinkin interfaceFileInfo
-
-