public class HTTPFileSystem
extends FileSystem
FileSystem
that is able to open HTTP files. Note that certain
features are not supported by the HTTP scheme by design. First, it is
read-only which makes all write functionality not supported. Second, it
cannot list contents of a directory. For listing, some web browsers provide a
default behavior that lists contents of a directory as HTTP links. We try to
use this feature as much as possible to simulate the list functionality.
The browsing feature in this class is designed specifically to browse LP DAAC
NASA archives. Although most of the implementation is generic, there are some
features that are hard-coded to work with LP DAAC and might not work with
other web sites.Modifier and Type | Field and Description |
---|---|
static Log |
LOG |
Constructor and Description |
---|
HTTPFileSystem() |
Modifier and Type | Method and Description |
---|---|
FSDataOutputStream |
append(Path f,
int bufferSize,
Progressable progress) |
FSDataOutputStream |
create(Path f,
FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
Progressable progress) |
boolean |
delete(Path f) |
boolean |
delete(Path f,
boolean recursive) |
FileStatus |
getFileStatus(Path f)
Returns the status of a file.
|
java.net.URI |
getUri() |
Path |
getWorkingDirectory() |
void |
initialize(java.net.URI uri,
Configuration conf) |
FileStatus[] |
listStatus(Path f)
Lists all files and directories in a given Path that points to a directory.
|
static void |
main(java.lang.String[] args) |
boolean |
mkdirs(Path f,
FsPermission permission) |
FSDataInputStream |
open(Path f,
int bufferSize) |
boolean |
rename(Path src,
Path dst) |
void |
setWorkingDirectory(Path new_dir) |
public void initialize(java.net.URI uri, Configuration conf) throws java.io.IOException
java.io.IOException
public java.net.URI getUri()
public FSDataInputStream open(Path f, int bufferSize) throws java.io.IOException
java.io.IOException
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws java.io.IOException
java.io.IOException
public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws java.io.IOException
java.io.IOException
public boolean rename(Path src, Path dst) throws java.io.IOException
java.io.IOException
public boolean delete(Path f) throws java.io.IOException
java.io.IOException
public boolean delete(Path f, boolean recursive) throws java.io.IOException
java.io.IOException
public FileStatus[] listStatus(Path f) throws java.io.IOException
java.io.IOException
public void setWorkingDirectory(Path new_dir)
public Path getWorkingDirectory()
public boolean mkdirs(Path f, FsPermission permission) throws java.io.IOException
java.io.IOException
public FileStatus getFileStatus(Path f) throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException