public class FileInfo
extends java.lang.Object
Constructor and Description |
---|
FileInfo(java.io.File file)
Initialize the new instance from the given file.
|
FileInfo(java.lang.String archiveName,
java.util.zip.ZipEntry zipEntry)
Initialize the new instance from the given zip file entry.
|
Modifier and Type | Method and Description |
---|---|
java.io.File |
asFile()
Returns the file this info objects describes or null if it is inside
an archive.
|
FileLocator |
asFileLocator()
Returns a FileLocator that corresponds to the file specified by this
FileInfo object.
|
java.net.URL |
asURL()
Returns the URL of the file this info objects describes.
|
java.lang.String |
getArchiveName()
Returns the name of the archive, the file is included in or null if the
file is located in the normal directory structure.
|
java.lang.String |
getFullName()
Returns the path + name of the file.
|
java.lang.String |
getLocation()
Returns the full location name, that is in case of a normal file the
path and filename combined.
|
java.lang.String |
getName()
Returns the name of the file (without any path).
|
java.lang.String |
getPath()
Returns the path (without filename) to the file.
|
long |
getSize()
Returns the size of the file in bytes
|
boolean |
isInArchive()
Returns the name of the archive, the file is included in or null if the
file is located in the normal directory structure.
|
long |
lastModified()
Returns the timestamp of the file's last modification
|
protected void |
lastModified(long newValue) |
protected void |
setArchiveName(java.lang.String newValue) |
protected void |
setName(java.lang.String newValue) |
protected void |
setPath(java.lang.String newValue) |
protected void |
setPathAndName(java.io.File file) |
protected void |
setSize(long newValue) |
java.lang.String |
toString() |
protected FileUtil |
util() |
public FileInfo(java.io.File file)
public FileInfo(java.lang.String archiveName, java.util.zip.ZipEntry zipEntry)
public boolean isInArchive()
public java.lang.String getArchiveName()
public java.lang.String getLocation()
public java.lang.String getFullName()
public java.lang.String getPath()
public java.lang.String getName()
public long getSize()
public long lastModified()
public FileLocator asFileLocator()
public java.io.File asFile()
public java.net.URL asURL() throws java.net.MalformedURLException
java.net.MalformedURLException
- if no appropriate URL can be created.public java.lang.String toString()
toString
in class java.lang.Object
protected void setArchiveName(java.lang.String newValue)
protected void setPath(java.lang.String newValue)
protected void setName(java.lang.String newValue)
protected void setSize(long newValue)
protected void lastModified(long newValue)
protected void setPathAndName(java.io.File file)
protected FileUtil util()