public class ChecksumUtils extends Object
Constructor and Description |
---|
ChecksumUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
maybeMigrateChecksumFormat(Algorithm checksumAlgorithm,
short checksumSuperBlockLength,
Path path)
maybeMigrateChecksumFormat is a helper util to migrate a given file path into the checksumAlgorithm file format.
|
static void |
maybeRemovePreviousFormatPath(Path path)
maybeRemovePreviousFormatPath is a helper util to delete (if exists) the previous format file.
|
static Path |
previousFormatPath(Path path)
previousFormatPath is a helper util to generate the path for previous format path.
|
static Algorithm |
tierStateFileAlgorithm(Path path)
Util method to return the type of checksum algorithm used for FTPS based on the input file name
|
public static void maybeMigrateChecksumFormat(Algorithm checksumAlgorithm, short checksumSuperBlockLength, Path path) throws IOException
Note that this method takes the destination file parameters as arguments and handles the various cases of whether the previous file exists or not
checksumAlgorithm
- the destination checksum algorithm to be migrated tochecksumSuperBlockLength
- the checksum super block length for destinationpath
- the destination file pathIOException
- If any I/O error occurspublic static Path previousFormatPath(Path path)
path
- the input file pathpublic static void maybeRemovePreviousFormatPath(Path path) throws IOException
path
- the current file pathIOException
- If any I/O error occurs