|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface VirtualFile
Abstraction of an entry in some VirtualFileSystem. It could be a wrapper around a java.io.File, or a java.util.zip.ZipEntry, or whatever file-like element is managed by that layer.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Method Summary | |
---|---|
boolean |
canRead()
Tests if the application can read from the specified file. |
boolean |
canWrite()
Tests if the application can write to this file. |
boolean |
createNewFile()
create this virtual file |
boolean |
delete()
Deletes the file specified by this object. |
boolean |
exists()
Tests if this File exists. |
java.lang.String |
getAbsolutePath()
Returns the absolute pathname of the file represented by this object. |
java.lang.String |
getCanonicalPath()
Returns the canonical form of this File object's pathname. |
long |
getChecksum()
get the checksum for the file |
VirtualFile |
getChild(java.lang.String name)
Get a child file of this file with a given name. |
VirtualFile |
getChild(atg.vfs.VirtualPath path)
Get a child file of this file with a given relative path. |
atg.vfs.VirtualFileDescriptor |
getFileDescriptor()
Get the VirtualFileDescriptor for this object |
VirtualFileSystem |
getFileSystem()
Get the file system used by this VirtualFile |
java.io.InputStream |
getInputStream()
Get an input stream for this file. |
long |
getLastModified()
Returns the time that the file represented by this File object was last modified. |
long |
getLength()
Returns the length of the file represented by this File object. |
java.lang.String[] |
getList()
Returns a list of the files in the directory specified by this File object. |
java.lang.String |
getName()
Returns the name of the file represented by this object. |
java.io.OutputStream |
getOutputStream()
Get an output stream for this file. |
java.lang.String |
getParent()
Returns the parent part of the pathname of this File
object, or null if the name has no parent part. |
VirtualFile |
getParentFile()
Returns the VirtualFile representing the parent directory of this VirtualFile object, or null
if this is the root file of the VirtualFileSystem. |
java.lang.String |
getPath()
Returns the pathname of the file represented by this object. |
java.lang.String |
getVFSName()
get the application specific name for the vfs that this virtual file lives in. |
atg.vfs.VirtualPath |
getVirtualPath()
Returns the pathname of the file represented by this object as a VirtualPath object. |
boolean |
hasDifferentCase()
Returns whether the case for the file on the file system is different than the case of the name used to obtain the file. |
boolean |
isAbsolute()
Tests if the file represented by this File object is an
absolute pathname. |
boolean |
isDirectory()
Tests if the file represented by this File
object is a directory. |
boolean |
isFile()
Tests if the file represented by this File
object is a "normal" file. |
long |
lastModified()
Returns the time that the file represented by this File object was last modified. |
long |
length()
Returns the length of the file represented by this File object. |
java.lang.String[] |
list()
Returns a list of the files in the directory specified by this File object. |
java.lang.String[] |
list(java.lang.String fileType)
Returns a list of the files in the directory specified by this File that are of the given type. |
java.lang.String[] |
list(VirtualFilenameFilter filter)
Returns a list of the files in the directory specified by this File that satisfy the specified filter. |
boolean |
mkdir()
Creates a directory whose pathname is specified by this File object. |
boolean |
mkdirs()
Creates a directory whose pathname is specified by this File object, including any necessary parent directories. |
boolean |
renameTo(VirtualFile dest)
Renames the file specified by this File object to
have the pathname given by the File argument. |
void |
setLastModified(long pTime)
Set the time that the file represented by this File object was last modified. |
java.lang.String |
toExternalForm()
Return a URL to the external form of this file system. |
java.lang.String |
toString()
Return a descriptive string for this file. |
Field Detail |
---|
static final java.lang.String CLASS_VERSION
Method Detail |
---|
java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
VirtualFile getChild(java.lang.String name)
VirtualFile getChild(atg.vfs.VirtualPath path)
java.lang.String toString()
toString
in class java.lang.Object
java.lang.String getName()
File
object.atg.vfs.VirtualPath getVirtualPath()
VirtualFile
object.VirtualFileSystem getFileSystem()
java.lang.String getPath()
File
object.java.lang.String getAbsolutePath()
File
.java.lang.String getCanonicalPath() throws java.io.IOException
File
object's pathname.
The precise definition of canonical form is system-dependent, but it
usually specifies an absolute pathname in which all relative references
and references to the current user directory have been completely
resolved. The canonical form of a pathname of a nonexistent file may
not be defined.
java.io.IOException
- If an I/O error occurs, which is possible because
the construction of the canonical path may require filesystem queries.java.lang.String getParent()
File
object, or null
if the name has no parent part. The parent
part is generally everything leading up to the last occurrence of the
separator character, although the precise definition is system
dependent. On UNIX, for example, the parent part of
"/usr/lib"
is "/usr"
, whose parent part is
"/"
, which in turn has no parent. On Windows platforms,
the parent part of "c:\java"
is "c:\"
, which
in turn has no parent.
VirtualFile getParentFile()
null
if this is the root file of the VirtualFileSystem.
boolean exists()
File
exists.
true
if the file specified by this object
exists; false
otherwise.
java.lang.SecurityException
- if a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.boolean canWrite()
true
if the application is allowed to write to
a file whose name is specified by this object;
false
otherwise.
java.lang.SecurityException
- if a security manager exists, its
checkWrite
method is called with the pathname
of this File
to see if the application is
allowed write access to the file.boolean canRead()
true
if the file specified by this object exists
and the application can read the file;
false
otherwise.
java.lang.SecurityException
- if a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.boolean isFile()
File
object is a "normal" file.
A file is "normal" if it is not a directory and, in addition, satisfies other system-dependent criteria. Any non-directory file created by a Java application is guaranteed to be a normal file.
true
if the file specified by this object
exists and is a "normal" file; false
otherwise.
java.lang.SecurityException
- If a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.atg.vfs.File#getPath()
,
SecurityManager.checkRead(java.lang.String)
boolean isDirectory()
File
object is a directory.
true
if this File
exists and is a
directory; false
otherwise.
java.lang.SecurityException
- if a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.atg.vfs.File#getPath()
,
SecurityManager.checkRead(java.lang.String)
boolean isAbsolute()
File
object is an
absolute pathname. The definition of an absolute pathname is system
dependent. For example, on UNIX, a pathname is absolute if its
first character is the separator character. On Windows platforms,
a pathname is absolute if its first character is an ASCII '\' or
'/', or if it begins with a letter followed by a colon.
true
if the pathname indicated by the
File
object is an absolute pathname;
false
otherwise.atg.vfs.File#getPath()
,
atg.vfs.File#separator
long lastModified()
File
object was last modified.
The return value is system dependent and should only be used to compare with other values returned by last modified. It should not be interpreted as an absolute time.
0L
if the specified file does not exist.
java.lang.SecurityException
- if a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.atg.vfs.File#getPath()
,
SecurityManager.checkRead(java.lang.String)
long getLastModified()
File
object was last modified. This method has been
added to expose this as a bean property.
The return value is system dependent and should only be used to compare with other values returned by last modified. It should not be interpreted as an absolute time.
0L
if the specified file does not exist.
java.lang.SecurityException
- if a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.lastModified()
,
atg.vfs.File#getPath()
,
SecurityManager.checkRead(java.lang.String)
void setLastModified(long pTime) throws java.io.IOException
File
object was last modified.
java.lang.SecurityException
- if a security manager exists, its
checkWrite
method is called with the pathname
of this File
to see if the application is
allowed write access to the file.
java.io.IOException
- If an I/O error occurs (if the file doesn't exist
or the file system doesn't support setting the
last modified date).SecurityManager.checkWrite(java.lang.String)
long length()
File
object.
0L
if the specified file does not exist.
java.lang.SecurityException
- if a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.atg.vfs.File#getPath()
,
SecurityManager.checkRead(java.lang.String)
long getLength()
File
object. This method has been added to expose
this as a bean property.
0L
if the specified file does not exist.
java.lang.SecurityException
- if a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.length()
,
atg.vfs.File#getPath()
,
SecurityManager.checkRead(java.lang.String)
boolean mkdir()
File
object.
true
if the directory could be created;
false
otherwise.
java.lang.SecurityException
- if a security manager exists, its
checkWrite
method is called with the pathname
of this File
to see if the application is
allowed write access to the file.atg.vfs.File#getPath()
,
SecurityManager.checkWrite(java.lang.String)
boolean renameTo(VirtualFile dest)
File
object to
have the pathname given by the File
argument.
dest
- the new filename.
true
if the renaming succeeds;
false
otherwise.
java.lang.SecurityException
- if a security manager exists, its
checkWrite
method is called both with the
pathname of this file object and with the pathname of the
destination target object to see if the application is
allowed to write to both files.atg.vfs.File#getPath()
,
SecurityManager.checkWrite(java.lang.String)
boolean mkdirs()
File
object, including any necessary parent directories.
true
if the directory (or directories) could be
created; false
otherwise.
java.lang.SecurityException
- if a security manager exists, its
checkWrite
method is called with the pathname
of each of the directories that is to be created, before
any of the directories are created.atg.vfs.File#getPath()
,
SecurityManager.checkWrite(java.lang.String)
java.lang.String[] list()
File
object.
.
" and "..
"
on Unix systems). If the VirtualFile does not refer to
a directory, an empty array is returned.
java.lang.SecurityException
- If a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.atg.vfs.File#getPath()
,
SecurityManager.checkRead(java.lang.String)
java.lang.String[] getList()
File
object. This method has been added to expose
this as a bean property.
.
" and "..
"
on Unix systems). If the VirtualFile does not refer to
a directory, an empty array is returned.
java.lang.SecurityException
- If a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.list()
,
atg.vfs.File#getPath()
,
SecurityManager.checkRead(java.lang.String)
java.lang.String[] list(VirtualFilenameFilter filter)
File
that satisfy the specified filter.
filter
- a filename filter.
.
" and "..
"
on Unix systems).
java.lang.SecurityException
- If a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.atg.vfs.File#getPath()
,
VirtualFilenameFilter
,
SecurityManager.checkRead(java.lang.String)
java.lang.String[] list(java.lang.String fileType)
File
that are of the given type.
fileType
- a file type
.
" and "..
"
on Unix systems).
java.lang.SecurityException
- If a security manager exists, its
checkRead
method is called with the pathname
of this File
to see if the application is
allowed read access to the file.atg.vfs.File#getPath()
,
VirtualFilenameFilter
,
SecurityManager.checkRead(java.lang.String)
boolean delete()
true
if the file is successfully deleted;
false
otherwise.
java.lang.SecurityException
- if a security manager exists, its
checkDelete
method is called with the
pathname of this File
to see if the
application is allowed to delete the file.atg.vfs.File#getPath()
,
SecurityManager.checkDelete(java.lang.String)
java.lang.String toExternalForm()
boolean hasDifferentCase()
java.lang.String getVFSName()
boolean createNewFile() throws java.io.IOException
java.io.IOException
atg.vfs.VirtualFileDescriptor getFileDescriptor()
long getChecksum() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |