Class DeleteOptions
All supplied conditions must hold for deletion to proceed. Unsupported options fail with OpenDALException.Code.Unsupported. Failed conditions fail with OpenDALException.Code.ConditionNotMatch.
Optional reference fields default to null.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringDelete only when the file at the delete path has this exact ETag.final StringDelete only when the file at the delete path does not have this ETag.final MetadataDelete only when the file at the delete path still has the identity recorded in this metadata.final StringDelete only when the file at the delete path has this exact version.final StringDelete only when the file at the delete path does not have this version.final booleanWhether to delete the target recursively.final StringDelete the given version of the file instead of the current one. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
version
Delete the given version of the file instead of the current one.This selects which stored version the delete removes; it is not a condition on the file.
- See Also:
-
recursive
public final boolean recursiveWhether to delete the target recursively.The default,
false, deletes a single object. Withtrue, a trailing slash (for example,"a/") scopes deletion to a directory and its descendants across services. Prefix matching for paths without a trailing slash is service-specific. On prefix-based services such asmemory,"a"also matches entries under"ab/".- See Also:
-
ifMatch
Delete only when the file at the delete path has this exact ETag.The condition succeeds when the file exists and its ETag equals this value. A file with a different ETag, or a missing file, fails the delete with
OpenDALException.Code.ConditionNotMatch. Only concrete ETag values are portable; a wildcard such as"*"has no portable meaning here.- See Also:
-
ifNoneMatch
Delete only when the file at the delete path does not have this ETag.With a concrete ETag value, the condition succeeds when the file has a different ETag or does not exist; deleting a missing file is then a successful no-op. A file whose ETag equals this value fails the delete with
OpenDALException.Code.ConditionNotMatch. Only concrete ETag values are portable; a wildcard such as"*"has no portable meaning here.- See Also:
-
ifVersionMatch
Delete only when the file at the delete path has this exact version.The condition succeeds when the file exists and its version equals this value. A file with a different version, or a missing file, fails the delete with
OpenDALException.Code.ConditionNotMatch.- See Also:
-
ifVersionNotMatch
Delete only when the file at the delete path does not have this version.The condition succeeds when the file exists with a different version. A file whose version equals this value fails the delete with
OpenDALException.Code.ConditionNotMatch. When no file exists at the delete path, no portable behavior is defined.- See Also:
-
ifNotChanged
Delete only when the file at the delete path still has the identity recorded in this metadata.Pass metadata previously returned by OpenDAL for the same path. OpenDAL derives a version match when the service supports version conditions and the metadata contains a version. Otherwise it uses a non-weak ETag if present. A changed or missing file fails the delete with
OpenDALException.Code.ConditionNotMatch, as does combining this option with a conflictingifMatchorifVersionMatchvalue.The operation returns
OpenDALException.Code.Unsupportedwhen the service does not support the derived primitive condition, andOpenDALException.Code.ConfigInvalidwhen the metadata contains neither a version nor a non-weak ETag.
-
-
Constructor Details
-
DeleteOptions
public DeleteOptions()
-