Package org.apache.nutch.util
Class FSUtils
java.lang.Object
org.apache.nutch.util.FSUtils
Utility methods for common filesystem operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseReaders(MapFile.Reader[] readers) Closes a group of MapFile readers.static voidcloseReaders(SequenceFile.Reader[] readers) Closes a group of SequenceFile readers.static voidreplace(FileSystem fs, Path current, Path replacement, boolean removeOld) Replaces the current path with the new path and if set removes the old path.
-
Constructor Details
-
FSUtils
public FSUtils()
-
-
Method Details
-
replace
public static void replace(FileSystem fs, Path current, Path replacement, boolean removeOld) throws IOException Replaces the current path with the new path and if set removes the old path. If removeOld is set to false then the old path will be set to the name current.old.- Parameters:
fs- The FileSystem.current- The end path, the one being replaced.replacement- The path to replace with.removeOld- True if we are removing the current path.- Throws:
IOException- If an error occurs during replacement.
-
closeReaders
Closes a group of SequenceFile readers.- Parameters:
readers- The SequenceFile readers to close.- Throws:
IOException- If an error occurs while closing a reader.
-
closeReaders
Closes a group of MapFile readers.- Parameters:
readers- The MapFile readers to close.- Throws:
IOException- If an error occurs while closing a reader.
-