|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectoscript.fs.AbstractAbstractFile
public abstract class AbstractAbstractFile
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.
| Constructor Summary | |
|---|---|
AbstractAbstractFile(java.lang.String path,
boolean temp)
Class Constructor. |
|
| Method Summary | |
|---|---|
boolean |
canRead()
Is it possible to read from this file. |
boolean |
canWrite()
Is it possible to write to this file. |
boolean |
createNewFile()
Create a new empty file, if it does not yet exist. |
boolean |
delete()
Delete this file. |
boolean |
equals(java.lang.Object obj)
|
boolean |
exists()
Tests whether the file denoted by this abstract pathname exists. |
java.lang.String |
getExtension()
Get the extension, which indicates the type of file. |
java.lang.String |
getName()
Get the name of this file, which is the last component of the complete path. |
java.io.OutputStream |
getOutputStream(boolean append)
Get an output stream to write to this file. |
java.lang.String |
getPath()
Get the file path, which globally identifies the file. |
int |
hashCode()
|
boolean |
isDirectory()
Test whether this file is a directory. |
boolean |
isFile()
Test whether this file is a regular file. |
long |
lastModified()
Return the time of last modification. |
long |
length()
should be overriden to not provide a bogus answer |
boolean |
mkdir()
If this file does not exist, create it as a directory. |
boolean |
mkdirs()
If this file does not exist, create it as a directory. |
java.lang.String |
toString()
|
void |
touch()
Update the timestamp on this file to the current time. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface oscript.fs.AbstractFile |
|---|
getInputStream |
| Constructor Detail |
|---|
public AbstractAbstractFile(java.lang.String path,
boolean temp)
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 equals(java.lang.Object) any other file object.
path - the file nametemp - is this a unique temporary file| Method Detail |
|---|
public boolean canWrite()
canWrite in interface AbstractFilepublic boolean canRead()
canRead in interface AbstractFilepublic boolean exists()
exists in interface AbstractFiletrue iff the file existspublic boolean isDirectory()
isDirectory in interface AbstractFiletrue iff this file is a directorypublic boolean isFile()
isFile in interface AbstractFiletrue iff this file is a regular file.public long lastModified()
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.
lastModified in interface AbstractFilepublic long length()
length in interface AbstractFile
public boolean createNewFile()
throws java.io.IOException
createNewFile in interface AbstractFiletrue iff the file does not exist and was successfully
created.
java.io.IOException - if error
public void touch()
throws java.io.IOException
touch in interface AbstractFilejava.io.IOException - if error
public boolean delete()
throws java.io.IOException
delete in interface AbstractFiletrue iff the directory is successfully deleted.
- Throws:
java.io.IOException - if error
public boolean mkdir()
throws java.io.IOException
mkdir in interface AbstractFiletrue iff directory successfully created
java.io.IOException
public boolean mkdirs()
throws java.io.IOException
mkdirs in interface AbstractFiletrue iff directory successfully created
java.io.IOException
public java.io.OutputStream getOutputStream(boolean append)
throws java.io.IOException
getOutputStream in interface AbstractFilejava.io.IOException - if canWrite returns falsecanWrite()public java.lang.String getExtension()
getExtension in interface AbstractFilepublic java.lang.String getPath()
getPath in interface AbstractFilegetName()public java.lang.String getName()
getName in interface AbstractFilegetPath()public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||