Class WriteError
- java.lang.Object
-
- com.dropbox.core.v2.files.WriteError
-
public final class WriteError extends java.lang.ObjectThis 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
OTHERvalue will be used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWriteError.TagDiscriminating tag type forWriteError.
-
Field Summary
Fields Modifier and Type Field Description static WriteErrorDISALLOWED_NAMEDropbox will not save the file or folder because of its name.static WriteErrorINSUFFICIENT_SPACEThe user doesn't have enough available space (bytes) to write more data.static WriteErrorNO_WRITE_PERMISSIONThe user doesn't have permissions to write to the target location.static WriteErrorOPERATION_SUPPRESSEDThis file operation is not allowed at this path.static WriteErrorOTHERCatch-all used for unknown tag values returned by the Dropbox servers.static WriteErrorTEAM_FOLDERThis endpoint cannot move or delete team folders.static WriteErrorTOO_MANY_WRITE_OPERATIONSThere 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 WriteErrorconflict(WriteConflictError value)Returns an instance ofWriteErrorthat has its tag set toWriteError.Tag.CONFLICT.booleanequals(java.lang.Object obj)WriteConflictErrorgetConflictValue()Couldn't write to the target path because there was something in the way.java.lang.StringgetMalformedPathValue()The given path does not satisfy the required path format.inthashCode()booleanisConflict()booleanisDisallowedName()booleanisInsufficientSpace()booleanisMalformedPath()booleanisNoWritePermission()booleanisOperationSuppressed()booleanisOther()booleanisTeamFolder()booleanisTooManyWriteOperations()Returnstrueif this instance has the tagWriteError.Tag.TOO_MANY_WRITE_OPERATIONS,falseotherwise.static WriteErrormalformedPath()Returns an instance ofWriteErrorthat has its tag set toWriteError.Tag.MALFORMED_PATH.static WriteErrormalformedPath(java.lang.String value)Returns an instance ofWriteErrorthat has its tag set toWriteError.Tag.MALFORMED_PATH.WriteError.Tagtag()Returns the tag for this instance.java.lang.StringtoString()java.lang.StringtoStringMultiline()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 aswitchstatement to properly handle the different values for thisWriteError.If a tag returned by the server is unrecognized by this SDK, the
WriteError.Tag.OTHERvalue will be used.- Returns:
- the tag for this instance.
-
isMalformedPath
public boolean isMalformedPath()
- Returns:
trueif this instance is tagged asWriteError.Tag.MALFORMED_PATH,falseotherwise.
-
malformedPath
public static WriteError malformedPath(java.lang.String value)
Returns an instance ofWriteErrorthat 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
WriteErrorwith its tag set toWriteError.Tag.MALFORMED_PATH.
-
malformedPath
public static WriteError malformedPath()
Returns an instance ofWriteErrorthat 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
WriteErrorwith 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
Stringvalue associated with this instance ifisMalformedPath()istrue. - Throws:
java.lang.IllegalStateException- IfisMalformedPath()isfalse.
-
isConflict
public boolean isConflict()
- Returns:
trueif this instance is tagged asWriteError.Tag.CONFLICT,falseotherwise.
-
conflict
public static WriteError conflict(WriteConflictError value)
Returns an instance ofWriteErrorthat 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
WriteErrorwith its tag set toWriteError.Tag.CONFLICT. - Throws:
java.lang.IllegalArgumentException- ifvalueisnull.
-
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
WriteConflictErrorvalue associated with this instance ifisConflict()istrue. - Throws:
java.lang.IllegalStateException- IfisConflict()isfalse.
-
isNoWritePermission
public boolean isNoWritePermission()
- Returns:
trueif this instance is tagged asWriteError.Tag.NO_WRITE_PERMISSION,falseotherwise.
-
isInsufficientSpace
public boolean isInsufficientSpace()
- Returns:
trueif this instance is tagged asWriteError.Tag.INSUFFICIENT_SPACE,falseotherwise.
-
isDisallowedName
public boolean isDisallowedName()
- Returns:
trueif this instance is tagged asWriteError.Tag.DISALLOWED_NAME,falseotherwise.
-
isTeamFolder
public boolean isTeamFolder()
- Returns:
trueif this instance is tagged asWriteError.Tag.TEAM_FOLDER,falseotherwise.
-
isOperationSuppressed
public boolean isOperationSuppressed()
- Returns:
trueif this instance is tagged asWriteError.Tag.OPERATION_SUPPRESSED,falseotherwise.
-
isTooManyWriteOperations
public boolean isTooManyWriteOperations()
Returnstrueif this instance has the tagWriteError.Tag.TOO_MANY_WRITE_OPERATIONS,falseotherwise.- Returns:
trueif this instance is tagged asWriteError.Tag.TOO_MANY_WRITE_OPERATIONS,falseotherwise.
-
isOther
public boolean isOther()
- Returns:
trueif this instance is tagged asWriteError.Tag.OTHER,falseotherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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
-
-