public abstract class FileSystem
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
FileSystem.WriteMode |
Constructor and Description |
---|
FileSystem() |
Modifier and Type | Method and Description |
---|---|
abstract FSDataOutputStream |
create(Path f)
Create a file system with the OVERWRITE
|
abstract FSDataOutputStream |
create(Path f,
FileSystem.WriteMode writeMode)
Create a file system with the specific write mdoe
|
abstract boolean |
delete(Path f,
boolean recursive) |
boolean |
exists(Path path)
Check if the given path exsits
|
abstract long |
getDefaultBlockSize() |
abstract BlockLocation[] |
getFileBlockLocations(FileStatus file,
long start,
long len)
Return an array containing hostnames, offset and size of
portions of the given file.
|
abstract FileStatus |
getFileStatus(Path f)
Return a file status object that represents the path.
|
abstract java.net.URI |
getUri()
Returns a URI whose scheme and authority identify this file system.
|
abstract Path |
getWorkingDirectory()
Get the working Directory
|
abstract void |
initialize(java.net.URI name)
Called after a new FileSystem instance is constructed.
|
boolean |
isDirectory(Path path)
Check if directory
|
abstract boolean |
isDistributedFS() |
boolean |
isFile(Path path)
Check if file
|
boolean |
isSymlink(Path path)
check if isSymlink
|
abstract FileStatus[] |
listFiles(Path f)
List the statuses of the files/directories in the given path if the path is
a directory.
|
abstract FileStatus[] |
listStatus(Path f) |
abstract boolean |
mkdirs(Path f) |
abstract FSDataInputStream |
open(Path f)
Opens an FSDataInputStream at the indicated Path.
|
abstract FSDataInputStream |
open(Path f,
int bufferSize) |
abstract boolean |
rename(Path src,
Path dst) |
abstract void |
setWorkingDirectory(Path path)
Set the working Directory
|
public boolean isFile(Path path)
public boolean isDirectory(Path path)
public boolean isSymlink(Path path)
public abstract void setWorkingDirectory(Path path)
public abstract Path getWorkingDirectory()
public abstract java.net.URI getUri()
public abstract void initialize(java.net.URI name) throws java.io.IOException
name
- a URI
whose authority section names the host, port, etc.
for this file systemjava.io.IOException
public abstract FileStatus getFileStatus(Path f) throws java.io.IOException
f
- The path we want information fromjava.io.FileNotFoundException
- when the path does not exist;
IOException see specific implementationjava.io.IOException
public abstract FileStatus[] listFiles(Path f) throws java.io.IOException
f
- given pathjava.io.IOException
public abstract FSDataInputStream open(Path f) throws java.io.IOException
f
- the file to openjava.io.IOException
public boolean exists(Path path) throws java.io.IOException
java.io.IOException
public abstract BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws java.io.IOException
java.io.IOException
public abstract FSDataInputStream open(Path f, int bufferSize) throws java.io.IOException
java.io.IOException
public abstract FSDataOutputStream create(Path f) throws java.io.IOException
f
- pathjava.io.IOException
- if an error occurspublic abstract FSDataOutputStream create(Path f, FileSystem.WriteMode writeMode) throws java.io.IOException
f
- pathwriteMode
- weather overwrite or not, when creating new filesjava.io.IOException
- if an error occurspublic abstract boolean delete(Path f, boolean recursive) throws java.io.IOException
java.io.IOException
public abstract FileStatus[] listStatus(Path f) throws java.io.IOException
java.io.IOException
public abstract boolean mkdirs(Path f) throws java.io.IOException
java.io.IOException
public abstract boolean rename(Path src, Path dst) throws java.io.IOException
java.io.IOException
public abstract long getDefaultBlockSize()
public abstract boolean isDistributedFS()