Class WriteError
- java.lang.Object
-
- com.dropbox.core.v2.files.WriteError
-
public final class WriteError extends java.lang.Object
This class is an open tagged union. Tagged unions instances are always associated to a specific tag. This means only one of theisAbc()
methods will returntrue
. You can usetag()
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WriteError.Tag
Discriminating tag type forWriteError
.
-
Field Summary
Fields Modifier and Type Field 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
OPERATION_SUPPRESSED
This file operation is not allowed at this path.static WriteError
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.static WriteError
TEAM_FOLDER
This endpoint cannot move or delete team folders.static WriteError
TOO_MANY_WRITE_OPERATIONS
There are too many write operations in user's Dropbox.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WriteError
conflict(WriteConflictError value)
Returns an instance ofWriteError
that has its tag set toWriteError.Tag.CONFLICT
.boolean
equals(java.lang.Object obj)
WriteConflictError
getConflictValue()
Couldn't write to the target path because there was something in the way.java.lang.String
getMalformedPathValue()
The given path does not satisfy the required path format.int
hashCode()
boolean
isConflict()
boolean
isDisallowedName()
boolean
isInsufficientSpace()
boolean
isMalformedPath()
boolean
isNoWritePermission()
boolean
isOperationSuppressed()
boolean
isOther()
boolean
isTeamFolder()
boolean
isTooManyWriteOperations()
Returnstrue
if this instance has the tagWriteError.Tag.TOO_MANY_WRITE_OPERATIONS
,false
otherwise.static WriteError
malformedPath()
Returns an instance ofWriteError
that has its tag set toWriteError.Tag.MALFORMED_PATH
.static WriteError
malformedPath(java.lang.String value)
Returns an instance ofWriteError
that has its tag set toWriteError.Tag.MALFORMED_PATH
.WriteError.Tag
tag()
Returns the tag for this instance.java.lang.String
toString()
java.lang.String
toStringMultiline()
Returns a String representation of this object formatted for easier readability.
-
-
-
Field Detail
-
NO_WRITE_PERMISSION
public static final WriteError NO_WRITE_PERMISSION
The user doesn't have permissions to write to the target location.
-
INSUFFICIENT_SPACE
public static final WriteError INSUFFICIENT_SPACE
The user doesn't have enough available space (bytes) to write more data.
-
DISALLOWED_NAME
public static final WriteError DISALLOWED_NAME
Dropbox will not save the file or folder because of its name.
-
TEAM_FOLDER
public static final WriteError TEAM_FOLDER
This endpoint cannot move or delete team folders.
-
OPERATION_SUPPRESSED
public static final WriteError OPERATION_SUPPRESSED
This file operation is not allowed at this path.
-
TOO_MANY_WRITE_OPERATIONS
public static final WriteError TOO_MANY_WRITE_OPERATIONS
There are too many write operations in user's Dropbox. Please retry this request.
-
OTHER
public static final WriteError OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.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.
-
-
Method Detail
-
tag
public WriteError.Tag tag()
Returns the tag for this instance.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 returntrue
. Callers are recommended to use the tag value in aswitch
statement to properly handle the different values for thisWriteError
.If a tag returned by the server is unrecognized by this SDK, the
WriteError.Tag.OTHER
value will be used.- Returns:
- the tag for this instance.
-
isMalformedPath
public boolean isMalformedPath()
- Returns:
true
if this instance is tagged asWriteError.Tag.MALFORMED_PATH
,false
otherwise.
-
malformedPath
public static WriteError malformedPath(java.lang.String value)
Returns an instance ofWriteError
that has its tag set toWriteError.Tag.MALFORMED_PATH
.The given path does not satisfy the required path format. Please refer to the Path formats documentation for more information.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
WriteError
with its tag set toWriteError.Tag.MALFORMED_PATH
.
-
malformedPath
public static WriteError malformedPath()
Returns an instance ofWriteError
that has its tag set toWriteError.Tag.MALFORMED_PATH
.The given path does not satisfy the required path format. Please refer to the Path formats documentation for more information.
- Returns:
- Instance of
WriteError
with its tag set toWriteError.Tag.MALFORMED_PATH
.
-
getMalformedPathValue
public java.lang.String getMalformedPathValue()
The given path does not satisfy the required path format. Please refer to the Path formats documentation for more information.This instance must be tagged as
WriteError.Tag.MALFORMED_PATH
.- Returns:
- The
String
value associated with this instance ifisMalformedPath()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisMalformedPath()
isfalse
.
-
isConflict
public boolean isConflict()
- Returns:
true
if this instance is tagged asWriteError.Tag.CONFLICT
,false
otherwise.
-
conflict
public static WriteError conflict(WriteConflictError value)
Returns an instance ofWriteError
that has its tag set toWriteError.Tag.CONFLICT
.Couldn't write to the target path because there was something in the way.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
WriteError
with its tag set toWriteError.Tag.CONFLICT
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
.
-
getConflictValue
public WriteConflictError getConflictValue()
Couldn't write to the target path because there was something in the way.This instance must be tagged as
WriteError.Tag.CONFLICT
.- Returns:
- The
WriteConflictError
value associated with this instance ifisConflict()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisConflict()
isfalse
.
-
isNoWritePermission
public boolean isNoWritePermission()
- Returns:
true
if this instance is tagged asWriteError.Tag.NO_WRITE_PERMISSION
,false
otherwise.
-
isInsufficientSpace
public boolean isInsufficientSpace()
- Returns:
true
if this instance is tagged asWriteError.Tag.INSUFFICIENT_SPACE
,false
otherwise.
-
isDisallowedName
public boolean isDisallowedName()
- Returns:
true
if this instance is tagged asWriteError.Tag.DISALLOWED_NAME
,false
otherwise.
-
isTeamFolder
public boolean isTeamFolder()
- Returns:
true
if this instance is tagged asWriteError.Tag.TEAM_FOLDER
,false
otherwise.
-
isOperationSuppressed
public boolean isOperationSuppressed()
- Returns:
true
if this instance is tagged asWriteError.Tag.OPERATION_SUPPRESSED
,false
otherwise.
-
isTooManyWriteOperations
public boolean isTooManyWriteOperations()
Returnstrue
if this instance has the tagWriteError.Tag.TOO_MANY_WRITE_OPERATIONS
,false
otherwise.- Returns:
true
if this instance is tagged asWriteError.Tag.TOO_MANY_WRITE_OPERATIONS
,false
otherwise.
-
isOther
public boolean isOther()
- Returns:
true
if this instance is tagged asWriteError.Tag.OTHER
,false
otherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toStringMultiline
public java.lang.String toStringMultiline()
Returns a String representation of this object formatted for easier readability.The returned String may contain newlines.
- Returns:
- Formatted, multiline String representation of this object
-
-