public abstract class AbstractPlexusIoResource extends java.lang.Object implements PlexusIoResource
PlexusIoResource
.Modifier and Type | Field and Description |
---|---|
private boolean |
isDirectory |
private boolean |
isExisting |
private boolean |
isFile |
private long |
lastModified |
private java.lang.String |
name |
private long |
size |
UNKNOWN_MODIFICATION_DATE, UNKNOWN_RESOURCE_SIZE
Modifier | Constructor and Description |
---|---|
protected |
AbstractPlexusIoResource(java.lang.String name,
long lastModified,
long size,
boolean isFile,
boolean isDirectory,
boolean isExisting) |
Modifier and Type | Method and Description |
---|---|
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. |
boolean |
isSymbolicLink()
Returns, whether the
FileInfo refers to a symlink. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContents, getURL
private final java.lang.String name
private final long lastModified
private final long size
private final boolean isFile
private final boolean isDirectory
private final boolean isExisting
protected AbstractPlexusIoResource(@Nonnull java.lang.String name, long lastModified, long size, boolean isFile, boolean isDirectory, boolean isExisting)
public long getLastModified()
PlexusIoResource
PlexusIoResource.UNKNOWN_MODIFICATION_DATE
.getLastModified
in interface PlexusIoResource
File.lastModified()
@Nonnull public java.lang.String getName()
FileInfo
File.pathSeparator
getName
in interface FileInfo
getName
in interface NameSupplier
public long getSize()
PlexusIoResource
PlexusIoResource.UNKNOWN_RESOURCE_SIZE
.getSize
in interface SizeSupplier
getSize
in interface PlexusIoResource
public boolean isDirectory()
PlexusIoResource
FileInfo
refers to a directory.isDirectory
in interface FileInfo
isDirectory
in interface PlexusIoResource
public boolean isExisting()
PlexusIoResource
isExisting
in interface PlexusIoResource
public boolean isFile()
PlexusIoResource
FileInfo
refers to a file.isFile
in interface FileInfo
isFile
in interface PlexusIoResource
public boolean isSymbolicLink()
FileInfo
FileInfo
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.isSymbolicLink
in interface FileInfo