public abstract class Directory extends Object
Java's i/o APIs not used directly, but rather all i/o is through this API. This permits things such as:
Constructor and Description |
---|
Directory() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Closes the store.
|
abstract OutputStream |
createFile(String name)
Creates a new, empty file in the directory with the given name.
|
abstract void |
deleteFile(String name)
Removes an existing file in the directory.
|
abstract boolean |
fileExists(String name)
Returns true iff a file with the given name exists.
|
abstract long |
fileLength(String name)
Returns the length of a file in the directory.
|
abstract long |
fileModified(String name)
Returns the time the named file was last modified.
|
abstract String[] |
list()
Returns an array of strings, one for each file in the directory.
|
abstract Lock |
makeLock(String name)
Construct a
Lock . |
abstract InputStream |
openFile(String name)
Returns a stream reading an existing file.
|
abstract void |
renameFile(String from,
String to)
Renames an existing file in the directory.
|
abstract void |
touchFile(String name)
Set the modified time of an existing file to now.
|
public abstract String[] list() throws IOException
IOException
public abstract boolean fileExists(String name) throws IOException
IOException
public abstract long fileModified(String name) throws IOException
IOException
public abstract void touchFile(String name) throws IOException
IOException
public abstract void deleteFile(String name) throws IOException
IOException
public abstract void renameFile(String from, String to) throws IOException
IOException
public abstract long fileLength(String name) throws IOException
IOException
public abstract OutputStream createFile(String name) throws IOException
IOException
public abstract InputStream openFile(String name) throws IOException
IOException
public abstract Lock makeLock(String name)
Lock
.name
- the name of the lock filepublic abstract void close() throws IOException
IOException
Copyright © 2024 GATE. All rights reserved.