Package org.gbif.utils.file
Class FileSplitter
java.lang.Object
org.gbif.utils.file.FileSplitter
A utility to split files into chucks.
This is done on file size, but then extended to read to the end of the current line.
Therefore a chunksize of 32meg will result in a split files of slightly more (assuming lines are
not very long).
This is done using NIO libraries for high performance.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionscanToChunk(File from, long chunkSizeBytes) Splits a file "pumaConcolor.txt" into the target directory using the suffix ("part") like so: - pumaConcolor_part_0.txt - pumaConcolor_part_1.txt - pumaConcolor_part_2.txt Returns the files parts
-
Field Details
-
SEPARATOR
- See Also:
-
READ_AHEAD_BYTES
- See Also:
-
-
Method Details
-
scanToChunk
- Throws:
IOException
-
split
public static List<File> split(File from, File targetDirectory, String suffix, long chunkSizeBytes) throws IOException Splits a file "pumaConcolor.txt" into the target directory using the suffix ("part") like so: - pumaConcolor_part_0.txt - pumaConcolor_part_1.txt - pumaConcolor_part_2.txt Returns the files parts- Throws:
IOException
-