Class LocalFileException

All Implemented Interfaces:
Serializable

public final class LocalFileException extends AnkaSecureSdkException
Thrown when a file operation fails on the caller's own file system: an input file could not be read, or the result — or a working file derived from the input — could not be written. Typical causes are a missing or unreadable input, a missing or read-only directory, a full disk, or a permission the process does not hold.

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.

See Also:
  • Constructor Details

    • LocalFileException

      public LocalFileException(Path path, LocalFileException.Access access, Throwable cause)
      Constructs a new local file-system failure.
      Parameters:
      path - the file the failed operation targeted (may be null when unknown)
      access - what the operation needed of the file (never null)
      cause - the local file-system failure (may be null)
  • Method Details