Class IOUtils
- java.lang.Object
-
- org.apache.cassandra.spark.bulkwriter.util.IOUtils
-
public final class IOUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringxxhash32(java.nio.file.Path path)Calculate the checksum of the file using the default buffer sizestatic java.lang.Stringxxhash32(java.nio.file.Path path, int bufferSize)Calculate the checksum of the file using the specified buffer sizestatic longzip(java.nio.file.Path sourcePath, java.nio.file.Path targetPath)Zip the files under source path.static longzip(java.nio.file.Path sourcePath, java.nio.file.Path targetPath, int maxDepth)Zip the files under source path.
-
-
-
Method Detail
-
zip
public static long zip(java.nio.file.Path sourcePath, java.nio.file.Path targetPath) throws java.io.IOExceptionZip the files under source path. It doest not zip recursively.- Parameters:
sourcePath- directory that contains files to be zippedtargetPath- output zip file path- Returns:
- compressed size, i.e. the size of the zip file
- Throws:
java.io.IOException- I/O exception during zipping
-
zip
public static long zip(java.nio.file.Path sourcePath, java.nio.file.Path targetPath, int maxDepth) throws java.io.IOExceptionZip the files under source path. The files within the maxDepth directory levels are considered.- Parameters:
sourcePath- directory that contains files to be zippedtargetPath- output zip file pathmaxDepth- the maximum number of directory levels to visit- Returns:
- compressed size, i.e. the size of the zip file
- Throws:
java.io.IOException- I/O exception during zipping
-
xxhash32
public static java.lang.String xxhash32(java.nio.file.Path path, int bufferSize) throws java.io.IOExceptionCalculate the checksum of the file using the specified buffer size- Parameters:
path- filebufferSize- buffer size for file content to calculate checksum- Returns:
- checksum string
- Throws:
java.io.IOException- I/O exception during checksum calculation
-
xxhash32
public static java.lang.String xxhash32(java.nio.file.Path path) throws java.io.IOExceptionCalculate the checksum of the file using the default buffer size- Parameters:
path- file- Returns:
- checksum string
- Throws:
java.io.IOException- I/O exception during checksum calculation
-
-