Class LocalFileException
- All Implemented Interfaces:
Serializable
This is a failure of the caller's machine, never of the network or the server. It is therefore
kept out of the SdkErrorCode.IO and SdkErrorCode.TIMEOUT classifications, which
describe the HTTP exchange and whose recovery advice (check connectivity, retry with backoff)
cannot fix a missing file or a full disk. Recovery is local: check the path named by
getPath() and what getAccess() needed of it, then retry.
A WRITE failure of the result commits nothing at the destination in the
default FAIL_IF_EXISTS policy: the quarantine sidecar is abandoned and a pre-existing
destination is left untouched. Under OVERWRITE, a platform that cannot replace a file
atomically has the destination deleted before the result is moved onto it, so a failure of that
move leaves no destination at all. Removing the abandoned sidecar is best-effort.
Extends AnkaSecureSdkException (the SDK's documented exception base) so it is caught by
a uniform catch (AnkaSecureSdkException e); being a client-side condition it carries no HTTP
status/body (AnkaSecureSdkException.getHttpStatus() is 0) and its error code is
SdkErrorCode.UNKNOWN. The originating IOException is attached as
Throwable.getCause(); its message is not copied into this one.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat the operation needed of the file. -
Field Summary
Fields inherited from class co.ankatech.ankasecure.sdk.exception.AnkaSecureSdkException
MAX_RETRY_AFTER_SECONDS -
Constructor Summary
ConstructorsConstructorDescriptionLocalFileException(Path path, LocalFileException.Access access, Throwable cause) Constructs a new local file-system failure. -
Method Summary
Modifier and TypeMethodDescriptionReturns what the operation needed of the file.getPath()Returns the file the failed operation targeted.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
-
LocalFileException
Constructs a new local file-system failure.- Parameters:
path- the file the failed operation targeted (may benullwhen unknown)access- what the operation needed of the file (nevernull)cause- the local file-system failure (may benull)
-
-
Method Details
-
getPath
Returns the file the failed operation targeted.- Returns:
- the path, or
nullwhen unknown
-
getAccess
Returns what the operation needed of the file.- Returns:
LocalFileException.Access.READorLocalFileException.Access.WRITE; nevernull
-