public class UnderFileSystemSingleLocal extends UnderFileSystem
UnderFileSystem.SpaceType
Constructor and Description |
---|
UnderFileSystemSingleLocal() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
OutputStream |
create(String path) |
OutputStream |
create(String path,
int blockSizeByte) |
OutputStream |
create(String path,
short replication,
int blockSizeByte) |
boolean |
delete(String path,
boolean recursive) |
boolean |
exists(String path) |
long |
getBlockSizeByte(String path) |
static UnderFileSystem |
getClient() |
Object |
getConf()
To get the configuration object for UnderFileSystem.
|
List<String> |
getFileLocations(String path) |
List<String> |
getFileLocations(String path,
long offset) |
long |
getFileSize(String path) |
long |
getModificationTimeMs(String path) |
long |
getSpace(String path,
UnderFileSystem.SpaceType type) |
boolean |
isFile(String path) |
String[] |
list(String path)
Returns an array of strings naming the files and directories in the directory denoted by this
abstract pathname.
|
boolean |
mkdirs(String path,
boolean createParent)
Creates the directory named by this abstract pathname.
|
InputStream |
open(String path) |
boolean |
rename(String src,
String dst) |
void |
setConf(Object conf)
To set the configuration object for UnderFileSystem.
|
void |
setPermission(String path,
String posixPerm)
Change posix file permission
|
get, get, parse
public static UnderFileSystem getClient()
public void close() throws IOException
close
in class UnderFileSystem
IOException
public OutputStream create(String path) throws IOException
create
in class UnderFileSystem
IOException
public OutputStream create(String path, int blockSizeByte) throws IOException
create
in class UnderFileSystem
IOException
public OutputStream create(String path, short replication, int blockSizeByte) throws IOException
create
in class UnderFileSystem
IOException
public boolean delete(String path, boolean recursive) throws IOException
delete
in class UnderFileSystem
IOException
public boolean exists(String path) throws IOException
exists
in class UnderFileSystem
IOException
public long getBlockSizeByte(String path) throws IOException
getBlockSizeByte
in class UnderFileSystem
IOException
public Object getConf()
UnderFileSystem
getConf
in class UnderFileSystem
public List<String> getFileLocations(String path) throws IOException
getFileLocations
in class UnderFileSystem
IOException
public List<String> getFileLocations(String path, long offset) throws IOException
getFileLocations
in class UnderFileSystem
IOException
public long getFileSize(String path) throws IOException
getFileSize
in class UnderFileSystem
IOException
public long getModificationTimeMs(String path) throws IOException
getModificationTimeMs
in class UnderFileSystem
IOException
public long getSpace(String path, UnderFileSystem.SpaceType type) throws IOException
getSpace
in class UnderFileSystem
IOException
public boolean isFile(String path) throws IOException
isFile
in class UnderFileSystem
IOException
public String[] list(String path) throws IOException
UnderFileSystem
If this abstract pathname does not denote a directory, then this method returns null
.
Otherwise an array of strings is returned, one for each file or directory in the directory.
Names denoting the directory itself and the directory's parent directory are not included in
the result. Each string is a file name rather than a complete path.
There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.
list
in class UnderFileSystem
path
- the path to list.null
if this abstract pathname does not denote a directory, or if an I/O error
occurs.IOException
public boolean mkdirs(String path, boolean createParent) throws IOException
UnderFileSystem
mkdirs
in class UnderFileSystem
path
- the folder to createcreateParent
- If true, the method creates any necessary but nonexistent parent directories.
Otherwise, the method does not create nonexistent parent directories.true
if and only if the directory was created; false
otherwiseIOException
public InputStream open(String path) throws IOException
open
in class UnderFileSystem
IOException
public boolean rename(String src, String dst) throws IOException
rename
in class UnderFileSystem
IOException
public void setConf(Object conf)
UnderFileSystem
setConf
in class UnderFileSystem
conf
- The configuration object accepted by ufs.public void setPermission(String path, String posixPerm) throws IOException
UnderFileSystem
setPermission
in class UnderFileSystem
path
- path of the fileposixPerm
- standard posix permission like "777", "775", etc.IOException
Copyright © 2014. All rights reserved.