AssetIndexReference, AssetObject, LibraryArtifact, LoggerConfigurationFilepublic class Download extends Object
| Modifier and Type | Field | Description |
|---|---|---|
static String |
CHECKSUM_ALGORITHM |
Defines the message digest algorithm name used to generate the checksum.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(Object o) |
|
void |
fetch(Path target) |
Downloads the file from the server and writes it to the specified target file.
|
String |
getSha1() |
Retrieves a sha1 checksum for the file in its valid state.
|
byte[] |
getSha1Bytes() |
Retrieves the actual decoded checksum bytes.
|
long |
getSize() |
Retrieves the total file size for this download (in bytes).
|
URL |
getUrl() |
Retrieves the absolute URL from which this file may be retrieved.
|
int |
hashCode() |
|
boolean |
verify(Path path) |
Evaluates whether a specified file matches the checksum and size of this downloadable
artifact.
|
public static final String CHECKSUM_ALGORITHM
public void fetch(@NonNull
Path target)
throws IOException
target - a target file.IOException - when the server is unreachable, responds with an error code, the connection
is interrupted or when writing to the file fails.@NonNull public String getSha1()
public byte[] getSha1Bytes()
IllegalStateException - when the hash is of an illegal length.public long getSize()
@NonNull public URL getUrl()
public boolean verify(@NonNull
Path path)
throws IOException
path - a file path.IOException - when accessing the target file fails.UnsupportedOperationException - when the JVM does not support the checksum algorithm.Copyright © 2018 Basin. All rights reserved.