|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.topcoder.file.split.FileJoiner
public class FileJoiner
This class facilitates rejoining pieces of a file (split files) together to recreate the original file. Methods here provide a means to join multiple files created by a FileSplitter back into one file.
| Constructor Summary | |
|---|---|
FileJoiner(java.io.File firstSplitFile)
Creates a FileJoiner from the given first split file. |
|
| Method Summary | |
|---|---|
java.io.File[] |
getExpectedSplitFiles()
Returns the split files that are expected by this object, and that will be joined, by parsing the header in the first split file. |
java.io.File |
getFirstSplitFile()
|
java.io.File |
join()
This method joins smaller files into one large file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileJoiner(java.io.File firstSplitFile)
Creates a FileJoiner from the given first split file.
java.lang.IllegalArgumentException - if the first split file argument
is null| Method Detail |
|---|
public java.io.File getFirstSplitFile()
public java.io.File join()
throws java.io.IOException,
InvalidSplitFileHeaderException
This method joins smaller files into one large file.
It reads metadata about the split files (name of the original file, number of split files, format of their names, etc.) from the first split file given to this FileJoiner object.
A file is created with the same name as the original file (read from the metadata); all the split files are located, and their data is put into the joined file, in order.
If an error occurs while joining the file, this method attempts to delete the partially joined file.
InvalidSplitFileHeaderException - if the first split file's
header is not valid
java.io.FileNotFoundException - if the given first split file does
not exist
java.io.IOException - if an exception occurs while reading/writing file
data, or if the join file already exists or is not writable for any
reason
public java.io.File[] getExpectedSplitFiles()
throws java.io.IOException,
InvalidSplitFileHeaderException
Returns the split files that are expected by this object, and that will be joined, by parsing the header in the first split file.
InvalidSplitFileHeaderException - if the first split file's
header is not valid
java.io.IOException - if an error occurs while trying to determine what
split files are expected
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||