| java.lang.Object oscript.fs.AbstractAbstractFile
All known Subclasses: oscript.util.InputStreamFile,
AbstractAbstractFile | abstract public class AbstractAbstractFile implements AbstractFile,Serializable(Code) | | Abstract implementation of
AbstractFile ... hmm, the naming scheme
isn't working out so well here, because AbstractFile. isn't a good name
for an interface.
author: Rob Clark (rob@ti.com) |
Method Summary | |
public boolean | canRead() Is it possible to read from this file. | public boolean | canWrite() Is it possible to write to this file. | public boolean | createNewFile() Create a new empty file, if it does not yet exist. | public boolean | delete() Delete this file. | public boolean | equals(Object obj) | public boolean | exists() Tests whether the file denoted by this abstract pathname exists. | public String | getExtension() Get the extension, which indicates the type of file. | public String | getName() Get the name of this file, which is the last component of the complete path. | public OutputStream | getOutputStream(boolean append) Get an output stream to write to this file. | public String | getPath() Get the file path, which globally identifies the file. | public int | hashCode() | public boolean | isDirectory() Test whether this file is a directory. | public boolean | isFile() Test whether this file is a regular file. | public long | lastModified() Return the time of last modification. | public long | length() | public boolean | mkdir() If this file does not exist, create it as a directory. | public boolean | mkdirs() If this file does not exist, create it as a directory. | public String | toString() | public void | touch() Update the timestamp on this file to the current time. |
AbstractAbstractFile | public AbstractAbstractFile(String path, boolean temp)(Code) | | Class Constructor. If this file is created as a temporary file (ie.
temp is true ), then the path
is interpreted as a relative path, or filename with no path prefix,
and the file is created with a unique directory path, and the file
will not
AbstractAbstractFile.equals any other file object.
Parameters: path - the file name Parameters: temp - is this a unique temporary file |
canRead | public boolean canRead()(Code) | | Is it possible to read from this file.
|
canWrite | public boolean canWrite()(Code) | | Is it possible to write to this file.
|
createNewFile | public boolean createNewFile() throws IOException(Code) | | Create a new empty file, if it does not yet exist.
true iff the file does not exist and was successfullycreated. throws: IOException - if error |
delete | public boolean delete() throws IOException(Code) | | Delete this file. If this file is a directory, then the directory must
be empty.
true iff the directory is successfully deleted. throws: IOException - if error |
exists | public boolean exists()(Code) | | Tests whether the file denoted by this abstract pathname exists.
true iff the file exists |
getExtension | public String getExtension()(Code) | | Get the extension, which indicates the type of file. Usually the extension
is part of the filename, ie. if the extension was os, the filename
would end with .os.
a string indicating the type of file |
hashCode | public int hashCode()(Code) | | |
isDirectory | public boolean isDirectory()(Code) | | Test whether this file is a directory.
true iff this file is a directory |
isFile | public boolean isFile()(Code) | | Test whether this file is a regular file. A file is a regular file if
it is not a directory.
true iff this file is a regular file. |
lastModified | public long lastModified()(Code) | | Return the time of last modification. The meaning of these value is not
so important, but the implementation must ensure that a higher value is
returned for the more recent version of a given element. Ie. if at some
point this returns X, an AbstractFile representing the same
"file", but created at a later time, should return X if the file has not
been modified, or >X if the file has been modified.
larger value indicates more recent modification |
length | public long length()(Code) | | should be overriden to not provide a bogus answer
|
mkdir | public boolean mkdir() throws IOException(Code) | | If this file does not exist, create it as a directory.
true iff directory successfully created |
mkdirs | public boolean mkdirs() throws IOException(Code) | | If this file does not exist, create it as a directory. All necessary
parent directories are also created. If this operation fails, it may
have successfully created some or all of the parent directories.
true iff directory successfully created |
|
|