public class NioFileCopierWithProgressMeterResults
extends java.lang.Object
NioFileCopierWithProgressMeterResults
.
Designed to be a simple data object that holds information, not to be instantiated by a user directly.
Created by jonn on 9/4/18.Modifier and Type | Method and Description |
---|---|
java.lang.String |
getChecksum()
Get the checksum calculated against
dest . |
java.lang.String |
getChecksumAlgorithm()
Get the checksum algorithm used to calculate the checksum of the downloaded file.
|
java.nio.file.Path |
getDestination() |
java.lang.String |
getExpectedChecksum()
Get the expected checksum value for
dest as set by the user in NioFileCopierWithProgressMeter.setChecksumAlgorithmAndExpectedChecksum(String, String) . |
long |
getSize() |
java.nio.file.Path |
getSource() |
boolean |
isDestFileValid()
Returns whether the downloaded file is valid by comparing the
checksum and expectedChecksum values. |
boolean |
wasValidationRequested()
Get whether a user requested that a checksum be calculated on the downloaded file.
|
public java.nio.file.Path getSource()
Path
of the source file to copy.public java.nio.file.Path getDestination()
Path
to the resulting destination of the file after copy.public long getSize()
public boolean wasValidationRequested()
true
iff a checksum was calculated by during the transfer of the file. false
otherwise.public java.lang.String getChecksum()
dest
.
If no checksum has been calculated, will return an empty String
.dest
.public java.lang.String getChecksumAlgorithm()
String
.public java.lang.String getExpectedChecksum()
dest
as set by the user in NioFileCopierWithProgressMeter.setChecksumAlgorithmAndExpectedChecksum(String, String)
.
If no checksum has been set, will return an empty String
.dest
provided by the user in NioFileCopierWithProgressMeter.setChecksumAlgorithmAndExpectedChecksum(String, String)
.public boolean isDestFileValid()
checksum
and expectedChecksum
values.
Will perform a case-insensitive comparison between the values of checksum
and expectedChecksum
.
NOTE: If no checksum algorithm and expected value were specified in the NioFileCopierWithProgressMeterResults
,
then this method will return false
.true
if the checksum from the downloaded file matches the expected checksum previously given by the user.