Package org.eclipse.aether.transfer
Class ChecksumFailureException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.eclipse.aether.RepositoryException
-
- org.eclipse.aether.transfer.ChecksumFailureException
-
- All Implemented Interfaces:
java.io.Serializable
public class ChecksumFailureException extends RepositoryException
Thrown in case of a checksum failure during an artifact/metadata download. This exception is usually thrown in following cases:- actual checksum mismatch, see
mismatch(String, String, String) - lack of required checksums, see
noneAvailable(String, String) - processing problem during checksum checks (ie IO problem), see
processingFailure(String, Throwable)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ChecksumFailureException(boolean retryWorthy, java.lang.String message, java.lang.Throwable cause)Deprecated.Do not use this constructor, it lacks information.ChecksumFailureException(java.lang.String message)Deprecated.UsenoneAvailable(String, String)or other suitable helper method instead.ChecksumFailureException(java.lang.String expected, java.lang.String expectedKind, java.lang.String actual)Deprecated.Usemismatch(String, String, String)or other suitable helper method instead.ChecksumFailureException(java.lang.String message, java.lang.Throwable cause)Deprecated.UseprocessingFailure(String, Throwable)or other helper method instead.ChecksumFailureException(java.lang.Throwable cause)Deprecated.UseprocessingFailure(String, Throwable)or other helper method instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetActual()Gets the actual checksum for the downloaded artifact/metadata.java.lang.StringgetExpected()Gets the expected checksum for the downloaded artifact/metadata.java.lang.StringgetExpectedKind()Gets the expected checksum kind for the downloaded artifact/metadata.booleanisRetryWorthy()Indicates whether the corresponding download is retry-worthy.static ChecksumFailureExceptionmismatch(java.lang.String expected, java.lang.String expectedKind, java.lang.String actual)Use in case of checksum mismatch.static ChecksumFailureExceptionmismatchDetail(java.lang.String detail, java.lang.String expected, java.lang.String expectedKind, java.lang.String actual)Use in case of checksum mismatch.static ChecksumFailureExceptionnoneAvailable(java.lang.String message, java.lang.String expectedKind)Use in case of checksum not available.static ChecksumFailureExceptionprocessingFailure(java.lang.String message, java.lang.Throwable cause)Use in case of error, for example IO problem during checksum processing, calculation and alike.-
Methods inherited from class org.eclipse.aether.RepositoryException
getMessage
-
-
-
-
Constructor Detail
-
ChecksumFailureException
@Deprecated public ChecksumFailureException(java.lang.String expected, java.lang.String expectedKind, java.lang.String actual)
Deprecated.Usemismatch(String, String, String)or other suitable helper method instead.Creates a new exception with the specified expected, expected kind and actual checksum. The resulting exception isretry-worthy.- Parameters:
expected- The expected checksum as declared by the hosting repository, may benull.expectedKind- The expected checksum kind, may benull.actual- The actual checksum as computed from the local bytes, may benull.- Since:
- 1.8.0
-
ChecksumFailureException
@Deprecated public ChecksumFailureException(java.lang.String message)
Deprecated.UsenoneAvailable(String, String)or other suitable helper method instead.Creates a new exception with the specified detail message. The resulting exception is notretry-worthy. Use this constructor ONLY in cases like "no data to work with", like missing checksums. In every other case use some other constructor.- Parameters:
message- The detail message, may benull.
-
ChecksumFailureException
@Deprecated public ChecksumFailureException(java.lang.Throwable cause)
Deprecated.UseprocessingFailure(String, Throwable)or other helper method instead.Creates a new exception with the specified cause. The resulting exception is notretry-worthy. Use this constructor in case some other error (ie IO problem) prevented checksum calculation.- Parameters:
cause- The exception that caused this one, may benull.
-
ChecksumFailureException
@Deprecated public ChecksumFailureException(java.lang.String message, java.lang.Throwable cause)
Deprecated.UseprocessingFailure(String, Throwable)or other helper method instead.Creates a new exception with the specified detail message and cause. The resulting exception is notretry-worthy. Use this constructor in case some other error (ie IO problem) prevented checksum calculation.- Parameters:
message- The detail message, may benull.cause- The exception that caused this one, may benull.
-
ChecksumFailureException
@Deprecated public ChecksumFailureException(boolean retryWorthy, java.lang.String message, java.lang.Throwable cause)
Deprecated.Do not use this constructor, it lacks information.Creates a new exception with the specified retry flag, detail message and cause.- Parameters:
retryWorthy-trueif the exception is retry-worthy,falseotherwise.message- The detail message, may benull.cause- The exception that caused this one, may benull.
-
-
Method Detail
-
mismatch
public static ChecksumFailureException mismatch(java.lang.String expected, java.lang.String expectedKind, java.lang.String actual)
Use in case of checksum mismatch. Creates a new exception with the specified expected, expected kind and actual checksum. The resulting exception isretry-worthy. The checksum match check should have already happened, this method does not check for any kind of inequality.- Parameters:
expected- The expected checksum as declared by the hosting repository, may benull.expectedKind- The expected checksum kind, may benull.actual- The actual checksum as computed from the local bytes, may benull.- Since:
- 2.0.19
-
mismatchDetail
public static ChecksumFailureException mismatchDetail(java.lang.String detail, java.lang.String expected, java.lang.String expectedKind, java.lang.String actual)
Use in case of checksum mismatch. Creates a new exception with the specified expected, expected kind and actual checksum. The resulting exception isretry-worthy. The checksum match check should have already happened, this method does not check for any kind of inequality.- Parameters:
detail- The extra detail/information regarding mismatch.expected- The expected checksum as declared by the hosting repository, may benull.expectedKind- The expected checksum kind, may benull.actual- The actual checksum as computed from the local bytes, may benull.- Since:
- 2.0.19
-
noneAvailable
public static ChecksumFailureException noneAvailable(java.lang.String message, java.lang.String expectedKind)
Use in case of checksum not available. Optionally, one can specify which kind was not available.- Parameters:
message- The message.expectedKind- The expected checksum kind, may benull.- Since:
- 2.0.19
-
processingFailure
public static ChecksumFailureException processingFailure(java.lang.String message, java.lang.Throwable cause)
Use in case of error, for example IO problem during checksum processing, calculation and alike. Ideally, one should specify cause as well.- Parameters:
message- The message.cause- The cause.- Since:
- 2.0.19
-
getExpected
public java.lang.String getExpected()
Gets the expected checksum for the downloaded artifact/metadata.- Returns:
- The expected checksum as declared by the hosting repository or
nullif unknown.
-
getExpectedKind
public java.lang.String getExpectedKind()
Gets the expected checksum kind for the downloaded artifact/metadata.- Returns:
- The expected checksum kind or
nullif unknown. - Since:
- 1.8.0
-
getActual
public java.lang.String getActual()
Gets the actual checksum for the downloaded artifact/metadata.- Returns:
- The actual checksum as computed from the local bytes or
nullif unknown.
-
isRetryWorthy
public boolean isRetryWorthy()
Indicates whether the corresponding download is retry-worthy.- Returns:
trueif retrying the download might solve the checksum failure,falseif the checksum failure is non-recoverable.
-
-