|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.nutch.fs.NutchFileSystem
org.apache.nutch.fs.LocalFileSystem
Implement the NutchFileSystem interface for the local disk. This is pretty easy. The interface exists so we can use either remote or local Files very easily.
Field Summary |
Fields inherited from class org.apache.nutch.fs.NutchFileSystem |
LOG |
Constructor Summary | |
LocalFileSystem()
|
Method Summary | |
void |
close()
Shut down the FS. |
void |
completeLocalInput(File localFile)
We're done reading. |
void |
completeLocalOutput(File nfsWorkingFile,
File tmpLocalFile)
It's in the right place - nothing to do. |
void |
copyFromLocalFile(File src,
File dst)
Similar to moveFromLocalFile(), except the source is kept intact. |
void |
copyToLocalFile(File src,
File dst)
We can't delete the src file in this case. |
NFSOutputStream |
create(File f)
Create the file at f. |
NFSOutputStream |
create(File f,
boolean overwrite)
|
boolean |
delete(File f)
Get rid of File f, whether a true file or dir. |
boolean |
exists(File f)
Check if exists |
long |
getLength(File f)
|
String |
getName()
Returns a name for this filesystem, suitable to pass to NutchFileSystem.getNamed(String) . |
boolean |
isDirectory(File f)
|
File[] |
listFiles(File f)
|
void |
lock(File f,
boolean shared)
Obtain a filesystem lock at File f. |
void |
mkdirs(File f)
Make the given file and all non-existent parents into directories. |
void |
moveFromLocalFile(File src,
File dst)
In the case of the local filesystem, we can just rename the file. |
NFSInputStream |
open(File f)
Open the file at f |
void |
release(File f)
Release a held lock |
boolean |
rename(File src,
File dst)
Rename files/dirs |
File |
startLocalInput(File nfsInputFile,
File tmpLocalFile)
We can read directly from the real local fs. |
File |
startLocalOutput(File nfsOutputFile,
File tmpLocalFile)
We can write output directly to the final location |
String |
toString()
|
Methods inherited from class org.apache.nutch.fs.NutchFileSystem |
createNewFile, get, getNamed, isFile, listFiles, parseArgs |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LocalFileSystem() throws IOException
Method Detail |
public String getName()
NutchFileSystem
NutchFileSystem.getNamed(String)
.
getName
in class NutchFileSystem
public NFSInputStream open(File f) throws IOException
open
in class NutchFileSystem
IOException
public NFSOutputStream create(File f) throws IOException
create
in class NutchFileSystem
IOException
public NFSOutputStream create(File f, boolean overwrite) throws IOException
create
in class NutchFileSystem
IOException
public boolean rename(File src, File dst) throws IOException
rename
in class NutchFileSystem
IOException
public boolean delete(File f) throws IOException
delete
in class NutchFileSystem
IOException
public boolean exists(File f) throws IOException
NutchFileSystem
exists
in class NutchFileSystem
IOException
public boolean isDirectory(File f) throws IOException
isDirectory
in class NutchFileSystem
IOException
public long getLength(File f) throws IOException
getLength
in class NutchFileSystem
IOException
public File[] listFiles(File f) throws IOException
listFiles
in class NutchFileSystem
IOException
public void mkdirs(File f) throws IOException
NutchFileSystem
mkdirs
in class NutchFileSystem
IOException
public void lock(File f, boolean shared) throws IOException
lock
in class NutchFileSystem
IOException
public void release(File f) throws IOException
release
in class NutchFileSystem
IOException
public void moveFromLocalFile(File src, File dst) throws IOException
moveFromLocalFile
in class NutchFileSystem
IOException
public void copyFromLocalFile(File src, File dst) throws IOException
copyFromLocalFile
in class NutchFileSystem
IOException
public void copyToLocalFile(File src, File dst) throws IOException
copyToLocalFile
in class NutchFileSystem
IOException
public File startLocalOutput(File nfsOutputFile, File tmpLocalFile) throws IOException
startLocalOutput
in class NutchFileSystem
IOException
public void completeLocalOutput(File nfsWorkingFile, File tmpLocalFile) throws IOException
completeLocalOutput
in class NutchFileSystem
IOException
public File startLocalInput(File nfsInputFile, File tmpLocalFile) throws IOException
startLocalInput
in class NutchFileSystem
IOException
public void completeLocalInput(File localFile) throws IOException
completeLocalInput
in class NutchFileSystem
IOException
public void close() throws IOException
close
in class NutchFileSystem
IOException
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |