|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.file.FileLocator
public class FileLocator
This class mainly supports access to files which can be in the normal
file directory structure or inside zip archives.
The main purpose is to provide methods that transparently treat files
the same way whether they are in the normal directory structure or
inside archives.
The syntax is simply to allow archive names in a path name at any place
where a sub-directory name can be.
Examples:
| Field Summary | |
|---|---|
static java.lang.String |
TEMP_FILE_PREFIX
|
static java.lang.String |
TEMP_FILE_SUFFIX
|
| Method Summary | |
|---|---|
static FileLocator |
create(java.io.File file)
Create a file locator that corresponds to the given file name. |
static FileLocator |
create(java.lang.String filename)
Create a file locator that corresponds to the given file name. |
static FileLocator |
create(java.net.URL url)
Create a file locator that corresponds to the given URL. |
java.lang.Exception |
exception()
Returns the last exception that occured while using this locator or null, if no exception was thrown at all. |
boolean |
exists()
Returns whether or not the file specified by this locator exists. |
java.lang.String |
getAbsolutePath()
Returns the full absolute pathname. |
java.io.InputStream |
getInputStream()
Returns an opened input stream on the file defined by this locator. |
java.lang.String |
getOriginalFileName()
Returns the original (unchanged) filename as it was given to the create method of this locator. |
FileLocator |
getParent()
Returns the parent of the file represented by this locator |
java.lang.String |
getPath()
Returns the full pathname. |
java.lang.String |
getStandardizedAbsolutePath()
Returns the full absolute pathname in a standardized form. |
java.lang.String |
getStandardizedPath()
Returns the full pathname in a standardized for. |
boolean |
isDirectory()
Returns whether or not the name specified by this locator points to a directory. |
boolean |
isFile()
Returns whether or not the name specified by this locator points to a file. |
boolean |
isInArchive()
Returns whether or not the file specified by this locator is inside an archive. |
boolean |
isRemote()
Returns true if the locator points to a remote file or directory. |
long |
lastModified()
Returns the timestamp of when the file was last modified or 0 in any case of error. |
java.io.File |
realFile()
Returns the file that contains the data the locator points to. |
long |
size()
Returns the size of the file or 0 if it does not exist. |
java.net.URL |
toURL()
Returns the name of the file as an URL. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TEMP_FILE_PREFIX
public static final java.lang.String TEMP_FILE_SUFFIX
| Method Detail |
|---|
public java.lang.String getOriginalFileName()
public static FileLocator create(java.io.File file)
public static FileLocator create(java.net.URL url)
url - The url that specifies the filepublic static FileLocator create(java.lang.String filename)
filename - The name (or URL) that specifies the filepublic java.io.File realFile()
public boolean exists()
public boolean isFile()
public boolean isDirectory()
public boolean isRemote()
public long size()
public long lastModified()
public java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionpublic FileLocator getParent()
public boolean isInArchive()
public java.lang.String getPath()
public java.lang.String getAbsolutePath()
public java.lang.String getStandardizedPath()
public java.lang.String getStandardizedAbsolutePath()
public java.lang.Exception exception()
public java.net.URL toURL()
throws java.net.MalformedURLException
java.net.MalformedURLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||