public final class WriteError extends Object
isAbc()
methods will return true. You can use tag() to determine the
tag associated with this instance.
Open unions may be extended in the future with additional tags. If a new
tag is introduced that this SDK does not recognized, the OTHER value
will be used.
| Modifier and Type | Class and Description |
|---|---|
static class |
WriteError.Tag
Discriminating tag type for
WriteError. |
| Modifier and Type | Field and Description |
|---|---|
static WriteError |
DISALLOWED_NAME
Dropbox will not save the file or folder because of its name.
|
static WriteError |
INSUFFICIENT_SPACE
The user doesn't have enough available space (bytes) to write more data.
|
static WriteError |
NO_WRITE_PERMISSION
The user doesn't have permissions to write to the target location.
|
static WriteError |
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.
|
| Modifier and Type | Method and Description |
|---|---|
static WriteError |
conflict(WriteConflictError value)
Returns an instance of
WriteError that has its tag set to WriteError.Tag.CONFLICT. |
boolean |
equals(Object obj) |
WriteConflictError |
getConflictValue()
Couldn't write to the target path because there was something in the way.
|
String |
getMalformedPathValue()
This instance must be tagged as
WriteError.Tag.MALFORMED_PATH. |
int |
hashCode() |
boolean |
isConflict()
|
boolean |
isDisallowedName()
|
boolean |
isInsufficientSpace()
|
boolean |
isMalformedPath()
|
boolean |
isNoWritePermission()
|
boolean |
isOther()
|
static WriteError |
malformedPath()
Returns an instance of
WriteError that has its tag set to WriteError.Tag.MALFORMED_PATH. |
static WriteError |
malformedPath(String value)
Returns an instance of
WriteError that has its tag set to WriteError.Tag.MALFORMED_PATH. |
WriteError.Tag |
tag()
Returns the tag for this instance.
|
String |
toString() |
String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
public static final WriteError NO_WRITE_PERMISSION
public static final WriteError INSUFFICIENT_SPACE
public static final WriteError DISALLOWED_NAME
public static final WriteError OTHER
Receiving a catch-all value typically indicates this SDK version is not up to date. Consider updating your SDK version to handle the new tags.
public WriteError.Tag tag()
This class is a tagged union. Tagged unions instances are always
associated to a specific tag. This means only one of the isXyz()
methods will return true. Callers are recommended to use the tag
value in a switch statement to properly handle the different
values for this WriteError.
If a tag returned by the server is unrecognized by this SDK, the
WriteError.Tag.OTHER value will be used.
public boolean isMalformedPath()
true if this instance is tagged as WriteError.Tag.MALFORMED_PATH, false otherwise.public static WriteError malformedPath(String value)
WriteError that has its tag set to WriteError.Tag.MALFORMED_PATH.value - value to assign to this instance.WriteError with its tag set to WriteError.Tag.MALFORMED_PATH.public static WriteError malformedPath()
WriteError that has its tag set to WriteError.Tag.MALFORMED_PATH.WriteError with its tag set to WriteError.Tag.MALFORMED_PATH.public String getMalformedPathValue()
WriteError.Tag.MALFORMED_PATH.malformedPath(java.lang.String) value associated with this
instance if isMalformedPath() is true.IllegalStateException - If isMalformedPath() is false.public boolean isConflict()
true if this instance is tagged as WriteError.Tag.CONFLICT,
false otherwise.public static WriteError conflict(WriteConflictError value)
WriteError that has its tag set to WriteError.Tag.CONFLICT.
Couldn't write to the target path because there was something in the way.
value - value to assign to this instance.WriteError with its tag set to WriteError.Tag.CONFLICT.IllegalArgumentException - if value is null.public WriteConflictError getConflictValue()
This instance must be tagged as WriteError.Tag.CONFLICT.
conflict(com.dropbox.core.v2.files.WriteConflictError) value associated with this
instance if isConflict() is true.IllegalStateException - If isConflict() is false.public boolean isNoWritePermission()
true if this instance is tagged as WriteError.Tag.NO_WRITE_PERMISSION, false otherwise.public boolean isInsufficientSpace()
true if this instance is tagged as WriteError.Tag.INSUFFICIENT_SPACE, false otherwise.public boolean isDisallowedName()
true if this instance is tagged as WriteError.Tag.DISALLOWED_NAME, false otherwise.public boolean isOther()
true if this instance is tagged as WriteError.Tag.OTHER,
false otherwise.public String toStringMultiline()
The returned String may contain newlines.