public class LocalFileSystem extends Object implements FileSystem, Files.FSCapability
On Windows, this FileSystem also advertises support for all the single-letter file systems, eg A:, C:, D:
| Modifier and Type | Class and Description |
|---|---|
protected static class |
LocalFileSystem.LocalRandomAccessFile
A file that supports random access
|
DEL_ON_EXIT, LS_DIR, RANDOM_READ, RANDOM_WRITE, READ, STAT, WRITE| Constructor and Description |
|---|
LocalFileSystem() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead(String filename)
returns true if filename can be read
|
boolean |
canWrite(String filename)
returns true if filename can be written to
|
byte |
capabilities()
Get the capabilities of the file system
|
boolean |
delete(String filename)
Delete a file
|
boolean |
deleteOnExit(String pathname)
Delete the file on program exit
|
boolean |
exists(String filename)
Does the file exist?
|
String |
getParent(String path)
whats the parent path to this path - eg directory containing a file
|
boolean |
isDirectory(String path)
Does the path point to a directory
|
long |
length(String filename)
What is the length of the file?
|
String[] |
list(String path)
list contents of a directory etc
|
boolean |
mkdir(String filename)
Make a directory
|
String |
name()
Get the name of the file system
|
protected String |
normalise(String filename) |
RandomDataInput |
openFileRandom(String filename)
Opens an input random access file
|
InputStream |
openFileStream(String filename)
Opens an input file
|
boolean |
rename(String source,
String destination)
rename a file/dir to another name, on the same file system
|
String[] |
schemes()
Get the schemes
|
RandomDataOutput |
writeFileRandom(String filename)
Opens a writable random access file
|
OutputStream |
writeFileStream(String filename)
Opens an output file
|
public String name()
name in interface FileSystempublic byte capabilities()
capabilities in interface FileSystempublic String[] schemes()
schemes in interface FileSystempublic boolean exists(String filename)
exists in interface FileSystempublic boolean canRead(String filename)
canRead in interface FileSystempublic boolean canWrite(String filename)
canWrite in interface FileSystempublic InputStream openFileStream(String filename) throws IOException
openFileStream in interface FileSystemIOExceptionpublic OutputStream writeFileStream(String filename) throws IOException
writeFileStream in interface FileSystemIOExceptionpublic RandomDataInput openFileRandom(String filename) throws IOException
openFileRandom in interface FileSystemIOExceptionpublic RandomDataOutput writeFileRandom(String filename) throws IOException
writeFileRandom in interface FileSystemIOExceptionpublic boolean delete(String filename)
delete in interface FileSystempublic boolean deleteOnExit(String pathname) throws IOException
deleteOnExit in interface FileSystemIOExceptionpublic boolean mkdir(String filename)
mkdir in interface FileSystempublic boolean isDirectory(String path)
isDirectory in interface FileSystempublic long length(String filename)
length in interface FileSystempublic boolean rename(String source, String destination) throws IOException
rename in interface FileSystemIOExceptionpublic String getParent(String path) throws IOException
getParent in interface FileSystemIOExceptionpublic String[] list(String path) throws IOException
list in interface FileSystemIOExceptionTerrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow