public class StdInOutFileSystem extends Object implements FileSystem
| Constructor and Description |
|---|
StdInOutFileSystem() |
| 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()
capabilities of the filesystem
|
boolean |
delete(String filename)
delete the named file
|
boolean |
deleteOnExit(String pathname)
delete the file after the JVM exits
|
boolean |
exists(String filename)
returns true if the path exists
|
String |
getParent(String path)
whats the parent path to this path - eg directory containing a file
|
boolean |
isDirectory(String path)
returns true if path is a directory
|
long |
length(String filename)
returns the length of the specified file
|
String[] |
list(String path)
list contents of a directory etc
|
boolean |
mkdir(String filename)
mkdir the specified path
|
String |
name()
returns a name for the filesystem
|
RandomDataInput |
openFileRandom(String filename)
open a file for random input
|
InputStream |
openFileStream(String filename)
open a file of given filename for readinng
|
boolean |
rename(String source,
String destination)
rename a file/dir to another name, on the same file system
|
String[] |
schemes()
URI schemes supported by this class
|
RandomDataOutput |
writeFileRandom(String filename)
open a file of given filename for random writing
|
OutputStream |
writeFileStream(String filename)
open a file of given filename for writing
|
public static final String SCHEME
public String name()
FileSystemname in interface FileSystempublic byte capabilities()
FileSystemcapabilities in interface FileSystempublic String[] schemes()
FileSystemschemes in interface FileSystempublic boolean exists(String filename) throws IOException
FileSystemexists in interface FileSystemIOExceptionpublic boolean canRead(String filename) throws IOException
FileSystemcanRead in interface FileSystemIOExceptionpublic boolean canWrite(String filename) throws IOException
FileSystemcanWrite in interface FileSystemIOExceptionpublic InputStream openFileStream(String filename) throws IOException
FileSystemopenFileStream in interface FileSystemIOExceptionpublic RandomDataInput openFileRandom(String filename) throws IOException
FileSystemopenFileRandom in interface FileSystemIOExceptionpublic OutputStream writeFileStream(String filename) throws IOException
FileSystemwriteFileStream in interface FileSystemIOExceptionpublic RandomDataOutput writeFileRandom(String filename) throws IOException
FileSystemwriteFileRandom in interface FileSystemIOExceptionpublic boolean delete(String filename) throws IOException
FileSystemdelete in interface FileSystemIOExceptionpublic boolean deleteOnExit(String pathname) throws IOException
FileSystemdeleteOnExit in interface FileSystemIOExceptionpublic boolean mkdir(String filename) throws IOException
FileSystemmkdir in interface FileSystemIOExceptionpublic long length(String filename) throws IOException
FileSystemlength in interface FileSystemIOExceptionpublic boolean isDirectory(String path) throws IOException
FileSystemisDirectory in interface FileSystemIOExceptionpublic boolean rename(String source, String destination) throws IOException
FileSystemrename in interface FileSystemIOExceptionpublic String getParent(String path) throws IOException
FileSystemgetParent in interface FileSystemIOExceptionpublic String[] list(String path) throws IOException
FileSystemlist in interface FileSystemIOExceptionTerrier Information Retrieval Platform 5.2. Copyright © 2004-2019, University of Glasgow