Class DestinationExistsException
- All Implemented Interfaces:
Serializable
FAIL_IF_EXISTS (the default) is in effect.
This is distinct from StreamIntegrityException: it signals a destination-collision
refusal, NOT an integrity failure. In every case the sidecar (<destination>.part) has
already been deleted and the pre-existing destination is left byte-for-byte untouched — the
atomic rename itself is the TOCTOU race guard, so a destination that appears between the writability
preflight and the promotion is never clobbered.
To overwrite intentionally, derive an overwrite-enabled instance with
AuthenticatedSdk.withOverwrite() (or
withOverwritePolicy(OverwritePolicy.OVERWRITE)).
Extends AnkaSecureSdkException (the SDK's documented exception base) so it is caught by
a uniform catch (AnkaSecureSdkException e); being a client-side collision it carries no
HTTP status/body (AnkaSecureSdkException.getHttpStatus() is 0).
- Since:
- 3.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDestinationExistsException(Path destination, Throwable cause) Constructs a new destination-collision exception. -
Method Summary
Modifier and TypeMethodDescriptionReturns the destination path that already exists.Methods inherited from class co.ankatech.ankasecure.sdk.exception.AnkaSecureSdkException
getContext, getErrorCode, getHttpStatus, getResponseBody, getRetryAfterSecondsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
DestinationExistsException
Constructs a new destination-collision exception.- Parameters:
destination- the destination path that already exists (may benull)cause- the underlyingFileAlreadyExistsException(may benull)
-
-
Method Details
-
getDestination
Returns the destination path that already exists.- Returns:
- the destination path, or
nullwhen unknown
-