|
|||||||||
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 fileMethod Detail |
---|
public boolean canWrite()
canWrite
in interface AbstractFile
public boolean canRead()
canRead
in interface AbstractFile
public boolean exists()
exists
in interface AbstractFile
true
iff the file existspublic boolean isDirectory()
isDirectory
in interface AbstractFile
true
iff this file is a directorypublic boolean isFile()
isFile
in interface AbstractFile
true
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 AbstractFile
public long length()
length
in interface AbstractFile
public boolean createNewFile() throws java.io.IOException
createNewFile
in interface AbstractFile
true
iff the file does not exist and was successfully
created.
java.io.IOException
- if errorpublic void touch() throws java.io.IOException
touch
in interface AbstractFile
java.io.IOException
- if errorpublic boolean delete() throws java.io.IOException
delete
in interface AbstractFile
true iff the directory is successfully deleted.
- Throws:
java.io.IOException
- if error
public boolean mkdir() throws java.io.IOException
mkdir
in interface AbstractFile
true
iff directory successfully created
java.io.IOException
public boolean mkdirs() throws java.io.IOException
mkdirs
in interface AbstractFile
true
iff directory successfully created
java.io.IOException
public java.io.OutputStream getOutputStream(boolean append) throws java.io.IOException
getOutputStream
in interface AbstractFile
java.io.IOException
- if canWrite
returns false
canWrite()
public java.lang.String getExtension()
getExtension
in interface AbstractFile
public java.lang.String getPath()
getPath
in interface AbstractFile
getName()
public java.lang.String getName()
getName
in interface AbstractFile
getPath()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public 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 |