# 上传文件 API

# 1.请求地址

# (1) 根据路径上传

	POST  https://apigate.glodon.com/gdoc/v3/doc/{wsId}/file/data?filePath={filePath}&fileName={fileName}&size={size}&position={position}&digest={digest}
1

# (2) 根据Id上传(指定父路径)

POST  https://apigate.glodon.com/gdoc/v3/doc/{wsId}/file/data?parentId={parentId}&fileName={fileName}&size={size}&position={position}&digest={digest}
1

# 2.请求头 headers

名称 数据类型 是否必选 描述
Authorization String Bearer ${SERVICE_TOKEN}
Content-Type String application/octet-stream

# 3. 请求体

inputStream

# 4.参数解释

名称 数据类型 是否必选 示例(仅表示数据格式,具体的传参需要提前获取) 说明
wsId string Y ${your_workspace_id} 创建空间后返回的空间id
filePath string N /${path_to_store_your_file} 父路径 支持多级目录 表明当前文件会存放在空间中指定的目录下 类似于 linux 中 mkdir -p /{path}
fileName string Y ${your_file_name} 需要写全名比如abc.txt表示文件名abc 文件类型后缀txt;长度256。不能出现如下非法字符 {'/', '\n', '*', '\\', '<', '>', '|', '\"', ':', '?'}
size long Y 1000 单位 :字节
position long N 0 起始位置 覆盖远程字节
digest string N ${your_file_digest} 保留字段
parentId string N ${parentFileId_to_store_your_file} 上传到哪个父路径

上传支持2种方式(二选一):

filePath表示一个绝对路径,例如/a/b.txt表示你想要把你本地的文件上传到远程的/根目录下的/a文件夹下,并命名为b.txt

parentId + fileName,例如parentId=sdsds&fileName=b.txt表示你想要把你本地的文件上传到远程一个fileId=sdsds的文件夹下,并把你要上传的文件命名为b.txt。如果不传parentId,默认会把文件存放在空间根目录

# 5. 返回信息

{
  "code": 0,//成功返回0
  "message": "success",
  "data": {
    "fileId": "87ec93645b7a406498cf76a8e5ddb3c5",//文件Id
    "workspaceId": "34834edbfe9c4e468875c18edbe45832",//空间Id
    "name": "token.txt",//文件名字
    "suffix": "txt",//文件名字后缀
    "folder": false,//是否是文件夹
    "length": 10,//文件大小
    "parentId": "b77abbcee06e4465aad15b2709ef3e87",//父文件Id,若为根目录,则为null
    "appKey": null,
    "creatorId": "6397625465775580100",
    "creatorName": "17640411890",
    "createTime": 1525848738368,
    "storeId": "54e23c4125b34759af0751d21fc20ec9",
    "digest": "54e23c4125b34759af0751d21fc20ec9",
    "thumbnail": null,
    "versionIndex": 3,//版本序号(3代表第三次重复上传同一个名称的文件)
    "ownerId": "NONE",
    "md5": "d893c967ca89d6581fc48ec99d95d50f",
    "originalCreatorId": "6397625465775580100",
    "originalCreatorName": "17640411890",
    "originalCreateTime": 1525848562000,
    "modifyTime": 1525848738368,
    "modifierId": "6397625465775580100",
    "modifierName": "17640411890",
    "revisionId": "7732dc0d37fe4ceb9c0bc9b65412c491",//版本Id
    "current": true,//是否为当前版本
    "alias": null,//版本别名
    "index": 3//版本序号
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

# 6.常见异常码

code message 描述 cause
19001 invalid file id[{0}] parentId目录不存在
19002 parent file [{0}] is not folder 上级不是文件夹
19060 no permission to access file [{0}] 没有权限 目录权限<create
19014 invalid file name [{0}] 文件名称不能包含特殊字符 特殊符号如: '/', '\n','*', '\', '<', '>', '|', '"', ':', '?'
19017 file name too long 文件名称超过256个字符
19012 file size exceeds [{0}] 文件大小超过上限 文件大小>5G
19016 no enough space 空间容量超过上限 当前文件大小 + 已用容量 > 空间容量商业控权
19003 io stream exception IO异常
19005 invalid file path[{0}] 非法的路径
19010 forbidden upload empty file 禁止上传空文件

# 7. 补充异常码

//COMMON ERROR CODE (101 000 xxx)
    SUCCESS(0, "success", PassDocumentErrorType.GENERAL),
    UNKNOWN_ERROR(10000, "unknown exception", PassDocumentErrorType.GENERAL),
    DATABASE_ACCESS_ERROR(10001, "database access exception", PassDocumentErrorType.GENERAL),
    ACCESS_FORBIDDEN(10004, "access forbidden {0}", PassDocumentErrorType.GENERAL),
    FAILED_TO_GET_APP_ACCESS_TOKEN(10002, "failed to get gdoc app access token from ACCOUNT API {0}", PassDocumentErrorType.GENERAL),
    INVALID_REQUESTS(10005, "invalid requests : {0}", PassDocumentErrorType.GENERAL),
    APPKEY_NOT_MATCH(10006, "invalid appkey : {0}, target : {1}", PassDocumentErrorType.GENERAL),
    CURRENT_OPERATION_NOT_SUPPORT(10007, "current operation [{0}] not support", PassDocumentErrorType.GENERAL),
    EXCEEDED_MAX_CONCURRENT_REQUEST(10005, "exceeded max concurrent request", PassDocumentErrorType.GENERAL),
    INVALID_OWNER_ID(101000001, "invalid owner id: [{0}]", PassDocumentErrorType.GENERAL),
    BATCH_SIZE_LIMITED(101000002, "limited batch size, limit {0}, actual {1}", PassDocumentErrorType.GENERAL),
    STORE_USAGE_CREATE_FAILED(101000003, "create store usage failed with wsId {}", PassDocumentErrorType.GENERAL),
    STORE_USAGE_UPDATE_FAILED(101000004, "update store usage failed with wsId {}", PassDocumentErrorType.GENERAL),
    LOCK_AND_EXECUTE_FAILED(101000005, "lock and execute failed", PassDocumentErrorType.GENERAL),


    //FILE(101 001 xxx)
    INVALID_FILE_ID(19001, "invalid file id[{0}]", PassDocumentErrorType.FILE),
    PARENT_NOT_FOLDER(19002, "parent file [{0}] is not folder", PassDocumentErrorType.FILE),
    IO_STREAM_EXCEPTION(19003, "io stream exception", PassDocumentErrorType.FILE),
    NO_THUMBNAIL(19004, "thumbnail is not generated", PassDocumentErrorType.FILE),
    INVALID_FILE_PATH(19005, "invalid file path[{0}]", PassDocumentErrorType.FILE),
    FILE_EXIST(19006, "file[{0}] exist", PassDocumentErrorType.FILE),
    FOLDER_EXIST(19007, "folder[{0}] exist", PassDocumentErrorType.FILE),
    INVALID_REVISION_ID(19008, "invalid revision id[{0}]", PassDocumentErrorType.FILE),
    INVALID_FILE_ID_OR_VERSION_INDEX(19009, "invalid file id[{0}] or version index[{1}]", PassDocumentErrorType.FILE),
    UPLOAD_EMPTY_FILE(19010, "forbidden upload empty file", PassDocumentErrorType.FILE),
    FILE_NUMBER_EXCEEDS(19011, "file number exceeds [{0}]", PassDocumentErrorType.FILE),
    FILE_SIZE_EXCEEDS(19012, "file size exceeds [{0}]", PassDocumentErrorType.FILE),
    NO_SUCH_FILE_OR_FOLDER(19013, "folder or file [{0}] does not exist", PassDocumentErrorType.FILE),
    INVALID_FILE_NAME(19014, "invalid file name [{0}]", PassDocumentErrorType.FILE),
    PARENT_NULL(19015, "the parent node [{0}] is null", PassDocumentErrorType.FILE),
    NO_ENOUGH_SPACE(19016, "no enough space", PassDocumentErrorType.FILE),
    FILE_NAME_TOO_LONG(19017, "file name too long", PassDocumentErrorType.FILE),
    BATCH_FILES_NOT_IN_SAME_FOLDER(19018, "batch operate files not in same folder", PassDocumentErrorType.FILE),
    TARGET_FOLDER_CANNOT_CHILD_OR_CURRENT(19019, "target folder can't be child or current", PassDocumentErrorType.FILE),
    GET_FILE_STREAM_ERROR(19201, "failed to get file stream from backend storage service, file name: [{0}]", PassDocumentErrorType.FILE),
    STORE_FILE_STREAM_ERROR(19202, "failed to upload file [{0}] to backend storage", PassDocumentErrorType.FILE),
    INVALID_STORE_FILE_ID(19203, "invalid store file id, file name: [{0}]", PassDocumentErrorType.FILE),
    FILENODE_DOES_NOT_EXIST(19132, "fileNode does not exist, fileId/filePath [{0}]", PassDocumentErrorType.FILE),
    GET_FILE_SIGNEDURL_ERROR(19204, "failed to get file signedURL", PassDocumentErrorType.FILE),
    ILLEGAL_FILENODE(19205, "fileNode does not exist or is a folder type", PassDocumentErrorType.FILE),
    FOLDER_ONLY(19232, "fileNode {0} is not folder type", PassDocumentErrorType.FILE),
    OWNER_ONLY(19233, "user {0} is not owner, owner {1}", PassDocumentErrorType.FILE),
    BATCH_GET_FILE_META_NUM_EXCEED_MAX(19234, "failed to batch get file meta because of exceeding the max size", PassDocumentErrorType.FILE),
    EXCEED_MAX_SIZE (19235, "batch operate has exceeded the max size:[{0}]", PassDocumentErrorType.FILE),
    REQUEST_BODY_IS_EMPTY(19237, "request body should not be empty", PassDocumentErrorType.FILE),
    PARENT_ID_AND_PATH_BOTH_EMPTY(19028, "parent id and path can not be empty", PassDocumentErrorType.FILE),
    //还原文件
    RESTORE_FILE_FAILED(101001002,"failed to restore file,containerId: {0},fileId: {1}",PassDocumentErrorType.FILE),

    REQUEST_LOCK_TIMEOUT(19206, "distributed lock request timeout", PassDocumentErrorType.FILE),
    CREATE_FOLDER_ERROR(19207, "failed to create folder {0}", PassDocumentErrorType.FILE),


    FAILED_TO_UPDATE_REVISION_INFO(19209, "Failed to update file revision information like version alias or current, file revision id: [{0}]", PassDocumentErrorType.FILE),
    NO_OR_INVALID_CONTAINER_ID_SPECIFIED(19210, "No container id or invalid container id is specified", PassDocumentErrorType.FILE),
    INVALID_OR_NOT_A_TRASHED_ROOT_FILE(19211, "The specified file id is not valid or the target file is not a root trashed file", PassDocumentErrorType.FILE),

    FILE_REV_ID_OR_FILE_ID_COULD_NOT_BE_EMPTY(19208, "file revision id or file id could not be  empty", PassDocumentErrorType.FILE),
    FILE_PATH_IS_EMPTY(19212, "the specified file path is empty", PassDocumentErrorType.FILE),
    TOO_MANY_FILES_TO_DELETE(19213, "the number of files to be deleted is too large", PassDocumentErrorType.FILE),
    TRASH_FILE_PATH_IS_NULL(19236, "the recorded path of trash file {} should not be empty", PassDocumentErrorType.FILE),
    DELETE_FILE_GET_LOCK_ERROR(19238, "get lock failed when delete file [{0}] and cause by [{1}]", PassDocumentErrorType.FILE),

    REQUEST_TOO_FAST(19239, "request frequency is too high", PassDocumentErrorType.FILE),
    /**
     * 前三位101表示是gdoc
     * 中间三位001表示执行file操作
     * 001表示删除file失败
     * 示例:100002001表示删除gdoc file失败
     */
    FAILED_TO_DELETE_FILE(101001001, "failed to delete files in the container [{0}]", PassDocumentErrorType.FILE),
    TOO_MANY_DOWNLOADS(101001002, "too many download requests, limit {0}, current {1}, try later", PassDocumentErrorType.FILE),
    TOO_MANY_UPLOADS(101001003, "too many upload requests, limit {0}, current {1}, try later", PassDocumentErrorType.FILE),
    PRE_CHECK_FILE_UPLOAD_FAILED(101001004, "pre check file upload failed caused by [{0}]", PassDocumentErrorType.FILE),
    CREATE_FOLDER_RENAME_TOO_MANY_TIMES(101001005, "failed to create folder with auto rename for rename {0} times", PassDocumentErrorType.FILE),
    ORIGINAL_FILE_IS_FOLDER(101001006, "original file [{0}] is a folder", PassDocumentErrorType.FILE),

    //SHARE(101 002 xxx)
    INVALID_SHARE_TOKEN(19020, "invalid share token[{0}]", PassDocumentErrorType.SHARE),
    SHARE_TOKEN_EXPIRED(19021, "share token[{0}] is expired", PassDocumentErrorType.SHARE),
    SHARE_TOKEN_PASSWORD_WRONG(19022, "share token[{0}] password is wrong", PassDocumentErrorType.SHARE),
    OTHER_SHARE_TOKEN(19023, "can't operate other's share token[{0}]", PassDocumentErrorType.SHARE),
    EXPIRE_LATER_THAN_TODAY(19024, "expire time later than today", PassDocumentErrorType.SHARE),
    NO_PRIVILEGE(19025, "no privilege [{0}]", PassDocumentErrorType.SHARE),
    FILE_NOT_SHARED(19026, "file [{0}] is not shared in share [{1}]", PassDocumentErrorType.SHARE),
    NO_SHARED_FILE_ID_PROVIDED(19027, "No shared file id found", PassDocumentErrorType.SHARE),
    NO_SIGNED_URL_WITH_FOLDER(19028, "could not obtain signed url for a folder [{0}] with share token [{1}]", PassDocumentErrorType.SHARE),
    SHARE_FILE_DOWNLOAD_ERROR(19029, "failed to download share file id [{0}] with share token [{1}]", PassDocumentErrorType.SHARE),

    //PRIVILEGE(101 003 xxx)
    NO_PERMISSION_ACCESS_FILE(19060, "user [{0}] has no permission to access file [{1}]", PassDocumentErrorType.PRIVILEGE, "操作失败!您无权进行操作!"),
    NO_PERMISSION_ACCESS_FILE_BLACK_LIST(19068, "user [{0}] has black list to access file [{1}], required privilege [{2}]", PassDocumentErrorType.PRIVILEGE),
    GRAND_PRIVILEGE_FAILURE(19061, "grant privilege failure [{0}]", PassDocumentErrorType.PRIVILEGE),
    FAIL_TO_GET_WORKSPACE_QUOTA(19062, "fail to get workspace[{0}] quota", PassDocumentErrorType.PRIVILEGE),
    GDOC_READONLY(19063, "gdoc[{0}] is readonly, the corresponding workspace may have been expired.", PassDocumentErrorType.PRIVILEGE),
    GDOC_INACTIVE(19067, "gdoc[{0}] is inactive,  the corresponding workspace may have been expired.", PassDocumentErrorType.PRIVILEGE),
    NO_PERMISSIONS_SET_ON_NODE(19064, "this node[{0}] is not set permissions", PassDocumentErrorType.PRIVILEGE),
    USER_NO_PERMISSION(19065, "this user[{0}] is not permission", PassDocumentErrorType.PRIVILEGE),
    USER_NOT_IN_WORKSPACE(19066, "user[{0}] is not belong to workspace[{1}]", PassDocumentErrorType.PRIVILEGE),

    //COMMENT(101 004 xxx)
    COMMENT_SIZE_EXCEEDS(19080, "comment size exceeds [{0}]", PassDocumentErrorType.COMMENT),
    FILE_ID_EMPTY(19081, "file id is empty", PassDocumentErrorType.COMMENT),
    COMMENT_CONTENT_EMPTY(19082, "comment content is empty", PassDocumentErrorType.COMMENT),
    FAILED_TO_INSERT_COMMENT(19083, "failed to insert comment to database", PassDocumentErrorType.COMMENT),
    COMMENT_NOT_EXIST(19084, "comment [{0}] does not exist", PassDocumentErrorType.COMMENT),
    FAILED_TO_DELETE_COMMENT(19085, "failed to delete comment [{0}] from database", PassDocumentErrorType.COMMENT),
    NO_PERMISSION_DELETE_COMMENT(19086, "with no permission to delete comment", PassDocumentErrorType.COMMENT),
    COMMENT_NOT_BELONG_TO_FILE(19087, "comment not belong to the file[{}]", PassDocumentErrorType.COMMENT),
    COMMENT_ID_OR_FILE_ID_EMPTY(19088, "check file comment,comment id or file id should not be empty fileId:{}, commentId:{}", PassDocumentErrorType.COMMENT),

    //WORKSPACE(101 005 xxx)
    FAILED_TO_ACCESS_WORKSPACE_API(19090, "fail to access workspace api, workspace id is {0}", PassDocumentErrorType.WORKSPACE),
    FAILED_TO_GET_MEMBER_INFO(19091, "fail to get member info from workspace, code is {0} and message is {1}", PassDocumentErrorType.WORKSPACE),
    FAILED_TO_GET_QUOTA(19092, "fail to get quota from workspace, code is {0} and message is {1}", PassDocumentErrorType.WORKSPACE),
    FAILED_TO_SET_QUOTA(19093, "failed to set storeQuota for a repo {0}. {1}", PassDocumentErrorType.WORKSPACE),
    //MODEL(101 006 xxx)
    PREIVEW_NOT_SUPPORT(19100, "doesn't support previewing {0} file online", PassDocumentErrorType.MODEL),

    //VIEWCODE(101 007 xxx)
    VIEWCODE_EXPIRED(19130, "viewcode {0} is expired, please apply a new one", PassDocumentErrorType.VIEWCODE),
    FOLDER_CANNOT_APPLY_VIEWCODE(19131, "cannot apply viewcode for a folder {0}", PassDocumentErrorType.VIEWCODE),


    FAILED_TO_CALL_ORGANIZATION(19093, "fail to call organization, code is {0} and message is {1}", PassDocumentErrorType.ORGANZATION),
    //DEPARTMENT OR MEMBER(101 008 xxx)
    /**
     * 获取部门下面的成员详情服务器异常
     */
    GET_MEMBERINFO_PAGE_OF_DEPARTMENT_REMOTE_SERVICE_EXCEPTION(19200, "get member info page of department service exception.", PassDocumentErrorType.ORGANZATION),

    /**
     * 获取部门下面的成员详情客户端异常
     */
    GET_MEMBERINFO_PAGE_OF_DEPARTMENT_CLIENT_EXCEPTION(19201, "get member info page of department client exception.", PassDocumentErrorType.ORGANZATION),


    /**
     * 获取成员服务器异常
     */
    GET_MEMBER_REMOTE_SERVICE_EXCEPTION(19202, "get member service exception. {0}", PassDocumentErrorType.ORGANZATION),

    /**
     * 获取成员客户端异常
     */
    GET_MEMBER_CLIENT_EXCEPTION(19203, "get member client exception. {0}", PassDocumentErrorType.ORGANZATION),

    /**
     * 成员详情不存在
     */
    MEMBER_INFO_NOT_FOUND(19204, "member not found.", PassDocumentErrorType.ORGANZATION),

    /**
     * 获取指定角色成员服务器异常
     */
    GET_MEMBERS_BY_ROLE_SERVICE_EXCEPTION(19205, "get members by row remote service exception.", PassDocumentErrorType.ORGANZATION),

    /**
     * 获取指定角色成员客户端异常
     */
    GET_MEMBERS_BY_ROLE_CLIENT_EXCEPTION(19206, "get members by row client exception.", PassDocumentErrorType.ORGANZATION),


    /**
     * 获取子部门服务器异常
     */
    GET_SUB_DEPARTMENTS_REMOTE_SERVICE_EXCEPTION(19207, "get sub deparments remote service exception.", PassDocumentErrorType.ORGANZATION),

    /**
     * 获取子部门客户端异常
     */
    GET_SUB_DEPARTMENTS_CLIENT_EXCEPTION(19208, "get sub deparments client exception.", PassDocumentErrorType.ORGANZATION),


    /**
     * 服务器返回报文的时候,解析出错了
     */
    REMOTE_RESULT_UNRECOGNIZED_EXCEPTION(19209, "remote result unrecognized excetion.", PassDocumentErrorType.ORGANZATION),

    // repo & container(101 009 xxx)
    INSERT_REPO_INTO_DB_ERROR(19210, "error while inset repo into DB", PassDocumentErrorType.REPO_CONTAINER),

    NONROOT_CONTAINER_NEED_PARENT(19211, "should specify parent for non-root container", PassDocumentErrorType.REPO_CONTAINER),

    ONLY_OPEN_CONTAINER_CAN_BE_CLOSE(19212, "only open container can be close", PassDocumentErrorType.REPO_CONTAINER),

    FAILED_TO_UPDATE_CONTAINER(19213, "failed to update container", PassDocumentErrorType.REPO_CONTAINER),

    INVALID_CONTAINER_ID(19214, "invalid container id {0}", PassDocumentErrorType.REPO_CONTAINER),

    CONTAINER_STATUS_INVALID(19228, "invalid container id {0}, status {1}", PassDocumentErrorType.REPO_CONTAINER),

    INSERT_CONTAINER_INTO_DB_ERROR(19215, "error while inset container into DB", PassDocumentErrorType.REPO_CONTAINER),

    INVALID_CREATE_CONTAINER_REQUEST(19216, "invalid request of create container {0}", PassDocumentErrorType.REPO_CONTAINER),

    INVALID_UPDATE_CONTAINER_REQUEST(19217, "invalid request of update container {0}", PassDocumentErrorType.REPO_CONTAINER),

    INVALID_CREATE_REPO_REQUEST(19218, "invalid request of create repo {0}", PassDocumentErrorType.REPO_CONTAINER),

    CONTAINER_NAME_EXISTS(19219, "container name exists : {0}", PassDocumentErrorType.REPO_CONTAINER),

    FAILED_TO_COPY_CONTAINER(19220, "copy container failed : {0}", PassDocumentErrorType.REPO_CONTAINER),

    UNSUPPORTED_OPERATION_ON_CONTAINER(19221, "unsupported operation for container : {0} ", PassDocumentErrorType.REPO_CONTAINER),
    INVALID_REPO_ID(19230, "invalid repoId : {0} ", PassDocumentErrorType.REPO_CONTAINER),
    /**
     * 前三位101表示是gdoc
     * 中间三位009表示repo或者container的操作
     * 001表示删除repo失败
     * 示例:101010001表示删除gdoc repo失败
     */
    FAILED_TO_DELETE_REPO(101010001, "failed to delete repo [{0}]", PassDocumentErrorType.REPO_CONTAINER),

    /**
     * 获取orgGroup下面的部门
     */
    GET_ORGGROUP_DEPARTMENTS_CLIENT_EXCEPTION(19222, "get orgGroup departments client exception. {0}", PassDocumentErrorType.ORGANZATION),

    GET_ORG_CLIENT_EXCEPTION(19230, "get org client exception. {0}", PassDocumentErrorType.ORGANZATION),

    ORGGROUP_DEPARTMENTS_NOT_FOUND(19223, "org group departments not found {0}", PassDocumentErrorType.ORGANZATION),

    GET_ORGGROUP_DEPARTMENTS_REMOTE_SERVICE_ERROR(192224, "get orgGroup departments remote service error. {0}", PassDocumentErrorType.ORGANZATION),

    MEMBERS_NOT_FOUND(19226, "members not found {0}", PassDocumentErrorType.ORGANZATION),
    ORG_NOT_FOUND(19231, "members not found {0}", PassDocumentErrorType.ORGANZATION),

    MEMBER_NOT_IN_ORGGROUP(19227, "user [{0}] is not a valid member in workspace [{1}]", PassDocumentErrorType.ORGANZATION),
    USERID_NOT_MATCH_MEMBERID(19228, "userId [{0}] not match memberId [{1}]", PassDocumentErrorType.PRIVILEGE),

    OPERATION_CODE_ALREADY_APPLIED(19229, "optCode already applied for path - {0}", PassDocumentErrorType.FILE),


    //AppendFile(101 010 xxx)
    APPENDFILE_DOES_NOT_EXIST_OR_EXPIRED(19500, "AppendFile does not exist, appendFileId [{0}, containerId[{1}]]", PassDocumentErrorType.APPENDFILE),
    APPEND_POSITION_ERROR(19501, "error position to append upload, appendFileId[{0}, position [{1}]]", PassDocumentErrorType.APPENDFILE),
    APPEND_UPLOAD_INTERRUPTED(19502, "append upload is interruped, appendFileId[{0}]",  PassDocumentErrorType.APPENDFILE),
    INVALID_APPENDFILE_LENGTH(19503, "length [{}] for appendFile is null or too long.the length maximum is 5GB ",  PassDocumentErrorType.APPENDFILE),

    //multi part upload(101 011 xxx)
    INIT_MULTI_PART_UPLOAD_ERROR(19600, "init multiPart upload error with objectId[{}]", PassDocumentErrorType.MULTI_PART_UPLOAD),
    GET_MULTI_PART_UPLOAD_SIGNED_URL_ERROR(19601, "get multiPart upload signed url error with objectId [{0}] and uploadId [{1}}", PassDocumentErrorType.MULTI_PART_UPLOAD ),
    COMPLETE_MULTI_PART_UPLOAD_ERROR(19602, "complete multi part upload error with objectId [{0}] and uploadId [{1}}", PassDocumentErrorType.MULTI_PART_UPLOAD),
    LIST_MULTI_PARTS_ERROR(19603, "list multi parts error objectId [{0}] and uploadId [{1}}", PassDocumentErrorType.MULTI_PART_UPLOAD),
    GET_UPLOAD_ID_ERROR(19604, "there is no upload id with id [{0}}", PassDocumentErrorType.MULTI_PART_UPLOAD),
    MULTI_PART_UPLOAD_PATH_ERROR(19605, "path [{0}]in this container[{1}] has unused upload id", PassDocumentErrorType.MULTI_PART_UPLOAD),
    ABORT_MULTI_PART_UPLOAD_ERROR(19606, "abort multi part upload error ", PassDocumentErrorType.MULTI_PART_UPLOAD),
    COMPLETE_MULTI_PART_UPLOAD_VALID_ERROR(19607,"complete multipart upload valid error with containerId [{0}] id [{1}] path [{2}] actualSumMultiPartLength [{3}] and expectSumMultiPartLength [{4}]",PassDocumentErrorType.MULTI_PART_UPLOAD),
// max code 19603 - edit this every time you add ErrorCode

    // FileCommit TX start from 19700 (101 012 xxx)
    INVALID_COMMIT(19700, "commit TX deleted/not OPEN/timeout - {0}", PassDocumentErrorType.FILE_COMMIT_TX),
    COMMIT_RESOURCE_NOT_MATCH(19701, "commitId - [{0}], expected resource - {1}, actual resource - {2}", PassDocumentErrorType.FILE_COMMIT_TX),
    RESOURCE_LOCKED(19702, "{0}", PassDocumentErrorType.FILE_COMMIT_TX),
    TX_CHECK_FAILED(19703, "file tx resource - [workspaceId - {0}] check is FAILED, try later ", PassDocumentErrorType.FILE_COMMIT_TX),
    FILE_BATCH_COPY_ERROR(19800, "batch copy file is FAILED, [{0}]", PassDocumentErrorType.FILE),
//file merge(101 012 xxx)
    FILE_MERGE_CALL_NSS_CLIENT_ERROR(19801, "call nss client error when file merge with name [{0}]",PassDocumentErrorType.FILE),
    FILE_MERGE_FC_ERROR(19802, "file merge function invoker error with fileMergeId [{0}]", PassDocumentErrorType.FILE),
    FILE_MERGE_EXIST(19803, "current revision is merging with revisionId [{0}]", PassDocumentErrorType.FILE),
    FILE_MERGE_INFO_NOT_EXIST(19804, "file merge info not exist with containerId [{0}], fileId [{1}] ,fileMergeId [{2}]", PassDocumentErrorType.FILE),
//File Lock(101 013 xxx)
    FILE_HAVE_BEEN_LOCKED(19900, "current file [{0}] have been locked", PassDocumentErrorType.FILE),
    FILE_LOCK_CONTAINER_ID_IS_NULL(19901, "container id should not be empty when check file lock", PassDocumentErrorType.FILE),
    //Init appData (101 014 xxx)
    INIT_APP_DATA_APP_NAME_IS_NULL(20000,"app name should not be empth when initializing app data",PassDocumentErrorType.FILE),

    //image process
    INVALID_IMAGE_PROCESS_PARAM(101001000, "invalid image process param for {0}", PassDocumentErrorType.IMAGE_PROCESSING),
    EMPTY_IMAGE_PROCESS(101001001, "empty conversion is not support", PassDocumentErrorType.IMAGE_PROCESSING),
    DOWNLOAD_PROCESS_IMAGE_ERROR(101001002, "download processed image error", PassDocumentErrorType.IMAGE_PROCESSING),
    IMAGE_TRANSFER_NOT_FOUNT(101001003, "image transfer not fount, storeId:{0}, configId:{1}", PassDocumentErrorType.IMAGE_PROCESSING),
    IMAGE_CONVERTING(101001004, "image is converting now, storeId:{0}, configId:{1}", PassDocumentErrorType.IMAGE_PROCESSING),
    IMAGE_CONVERT_FAILED(101001005, "image convert failed, storeId:{0}, configId:{1}", PassDocumentErrorType.IMAGE_PROCESSING),

    //file snapshot
    INVALID_CONTAINER_OR_FILE_ID(101002001, "invalid container or file id", PassDocumentErrorType.FILE),
    SNAPSHOT_ID_IS_EMPTY(101002002, "snapshot id is empty ", PassDocumentErrorType.FILE),
    INVALID_FILE_SNAPSHOT(101002003, "invalid file snapshot {0} ", PassDocumentErrorType.FILE),
    GET_COMMENT_SNAPSHOT_FAILED(101002004, "get comment detail failed when file snapshot with message {}", PassDocumentErrorType.COMMENT),
    NO_SNAPSHOT_FOUND(101002005, "no snapshot found of share token [{0}]", PassDocumentErrorType.FILE),
    GET_MARKUP_SNAPSHOT_FAILED(101002006, "get markup detail failed when file snapshot with message {}", PassDocumentErrorType.FILE),
    SNAPSHOT_NOT_EXIST_IN_SHARE(101002007, "share [{0}] has no snapshot [{1}]", PassDocumentErrorType.FILE),

    //share
    INVALID_SHARE_TYPE(101003001, "invalid share type {0}", PassDocumentErrorType.FILE),
    SOURCE_FILE_NOT_FOUND(101003002, "transfer source file not found, fileId: {0}, versionIndex: {1}", PassDocumentErrorType.FILE),
    INVALID_TARGET_FOLDER(101003003, "invalid target parent folder [{}]", PassDocumentErrorType.FILE),
    NOT_SNAPSHOT_SHARE(101003004, "not snapshot share [{0}]", PassDocumentErrorType.FILE);

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
  • 在线客服

  • 意见反馈