public class YfyFileRequest extends Object
| Constructor and Description |
|---|
YfyFileRequest(YfyBaseClient.YfyInternalClient client) |
| Modifier and Type | Method and Description |
|---|---|
YfyFile |
copyFile(long fileId,
long targetFolderId)
Copy the specific file to a folder
|
SuccessResult |
deleteFile(long fileId)
Discard a file to the trash
|
SuccessResult |
deleteFileFromTrash(long fileId)
Permanently delete a specific file that is in the trash.
|
void |
directDownloadFile(long fileId,
String savePath)
Combine the
preSignatureDownload(long)
and downloadFile(String,String) method, direct download the file |
InputStream |
directDownloadFileStream(long fileId)
Combine the
preSignatureDownload(long)
and downloadFile(String,String) method, direct get a InputStream of the file |
YfyFile |
directUploadFile(long parentId,
String name,
InputStream fileStream)
Combine the
this#preSignatureUpload(long, String)
and this#uploadFile(String,InputStream) method, direct upload the file |
YfyFile |
directUploadFile(long parentId,
String name,
String filePath)
Combine the
this#preSignatureUpload(long, String)
and this#uploadFile(String,InputStream) method, direct upload the file |
YfyFile |
directUploadNewVersionFile(long fileId,
String name,
String remark,
InputStream fileStream)
Combine the
this#newVersionPreSignatureUpload(long,String,String)
and this#uploadFile(String,InputStream) method, direct upload the new version file |
YfyFile |
directUploadNewVersionFile(long fileId,
String name,
String remark,
String filePath)
Combine the
this#newVersionPreSignatureUpload(long,String,String)
and this#uploadFile(String,InputStream) method, direct upload the new version file |
void |
downloadFile(String downloadUrl,
String savePath)
When get a file download url, use this method to save the file to the certain path
|
void |
downloadFile(String downloadUrl,
String savePath,
YfyProgressListener progressListener)
When get a file download url, use this method to save the file to the certain path
|
InputStream |
downloadFileStream(String downloadUrl)
When get a file download url, use this method to get a InputStream of the file
|
InputStream |
downloadFileStream(String downloadUrl,
YfyProgressListener progressListener)
When get a file download url, use this method to get a InputStream of the file
|
DownloadPreviewResult |
downloadPreview(long fileId,
int pageIndex,
PreviewKindEnum previewKind)
Retrieve download url if the page count of result to
this#preview(long,PreviewKindEnum,boolean) more
than 1. |
YfyFile |
getFile(long fileId)
Retrieve file info
|
ListCommentResult |
listComment(long fileId)
List file's all comments' information
|
ListShareLinkResult |
listShareLink(long fileId,
int pageId)
List share links of a file
|
ListShareLinkResult |
listShareLink(long fileId,
int pageId,
long ownerId)
List file's share links created by specific owner
|
SuccessResult |
moveFile(long fileId,
long targetFolderId)
Move a file to another folder
|
String |
newVersionPreSignatureUpload(long fileId,
String name,
String remark)
Get the new version file upload url, then use the url to upload new version file.
|
String |
preSignatureDownload(long fileId)
Get file download url, then use the url to download file.
|
String |
preSignatureUpload(long parentId,
String name)
Get the file upload url, then use the url to upload file.
|
PreviewResult |
preview(long fileId,
PreviewKindEnum previewKind,
boolean forceRegenerate)
Retrieve preview image information and download url
|
SuccessResult |
restoreFileFromTrash(long fileId)
Restore a file that has been moved to the trash.
|
YfyFile |
updateFile(long fileId,
String newName,
String newDescription)
Update fields in file, including file name and file description
|
YfyFile |
uploadFile(String uploadUrl,
InputStream fileStream)
When get a file upload url, use this method to upload the file to the server
(note that real file name used name in pre signature arg)
|
YfyFile |
uploadFile(String uploadUrl,
InputStream fileStream,
long fileSize,
YfyProgressListener progressListener)
When get a file upload url, use this method to upload the file to the server
(note that real file name used name in pre signature arg)
|
YfyFile |
uploadFile(String uploadUrl,
String filePath)
When get a file upload url, use this method to upload the file to the server
(note that real file name used name in pre signature arg)
|
YfyFile |
uploadFile(String uploadUrl,
String filePath,
long fileSize,
YfyProgressListener progressListener)
When get a file upload url, use this method to upload the file to the server
(note that real file name used name in pre signature arg)
|
public YfyFileRequest(YfyBaseClient.YfyInternalClient client)
public YfyFile getFile(long fileId) throws YfyException
fileId - File id in fangcloudYfyExceptionpublic YfyFile updateFile(long fileId, String newName, String newDescription) throws YfyException
fileId - File id in fangcloudnewName - File new name, can not be nullnewDescription - File new description, can be nullYfyExceptionpublic SuccessResult deleteFile(long fileId) throws YfyException
fileId - File id in fangcloudYfyExceptionpublic SuccessResult deleteFileFromTrash(long fileId) throws YfyException
fileId - File id in fangcloudYfyExceptionpublic SuccessResult restoreFileFromTrash(long fileId) throws YfyException
fileId - File id in fangcloudYfyExceptionpublic SuccessResult moveFile(long fileId, long targetFolderId) throws YfyException
fileId - File id in fangcloudtargetFolderId - Folder id of the destination folder in fangcloudYfyExceptionpublic String preSignatureDownload(long fileId) throws YfyException
fileId - File id in fangcloudYfyExceptionpublic void downloadFile(String downloadUrl, String savePath) throws YfyException
downloadUrl - Download url returned by the preSignatureDownload(long)savePath - Where you'd like to save the fileYfyExceptionpublic void downloadFile(String downloadUrl, String savePath, YfyProgressListener progressListener) throws YfyException
downloadUrl - Download url returned by the preSignatureDownload(long)savePath - Where you'd like to save the fileprogressListener - Where get file upload progressYfyExceptionpublic InputStream downloadFileStream(String downloadUrl) throws YfyException
downloadUrl - Download url returned by the preSignatureDownload(long)YfyExceptionpublic InputStream downloadFileStream(String downloadUrl, YfyProgressListener progressListener) throws YfyException
downloadUrl - Download url returned by the preSignatureDownload(long)progressListener - Where get file upload progressYfyExceptionpublic void directDownloadFile(long fileId,
String savePath)
throws YfyException
preSignatureDownload(long)
and downloadFile(String,String) method, direct download the filefileId - File id in fangcloudsavePath - Where you'd like to save the fileYfyExceptionpublic InputStream directDownloadFileStream(long fileId) throws YfyException
preSignatureDownload(long)
and downloadFile(String,String) method, direct get a InputStream of the filefileId - File id in fangcloudYfyExceptionpublic String preSignatureUpload(long parentId, String name) throws YfyException
parentId - Parent folder id you want to store the file in, the root folder is 0name - File nameYfyExceptionpublic String newVersionPreSignatureUpload(long fileId, String name, String remark) throws YfyException
fileId - Origin file id in fangcloudname - File name of the new versionremark - remark of the new versionYfyExceptionpublic YfyFile uploadFile(String uploadUrl, String filePath) throws YfyException, FileNotFoundException
uploadUrl - Upload url returned by the this#preSignatureUpload(long,String)filePath - Path of the file which you'd like to upload to serverYfyExceptionFileNotFoundExceptionpublic YfyFile uploadFile(String uploadUrl, String filePath, long fileSize, YfyProgressListener progressListener) throws YfyException, FileNotFoundException
uploadUrl - Upload url returned by the this#preSignatureUpload(long,String)filePath - Path of the file which you'd like to upload to serverfileSize - The size of fileprogressListener - Where get file upload progressYfyExceptionFileNotFoundExceptionpublic YfyFile uploadFile(String uploadUrl, InputStream fileStream) throws YfyException
uploadUrl - Upload url returned by the this#preSignatureUpload(long,String)fileStream - The file stream which you'd like to upload to serverYfyExceptionpublic YfyFile uploadFile(String uploadUrl, InputStream fileStream, long fileSize, YfyProgressListener progressListener) throws YfyException
uploadUrl - Upload url returned by the this#preSignatureUpload(long,String)fileStream - The file stream which you'd like to upload to serverfileSize - The size of fileprogressListener - Where get file upload progressYfyExceptionpublic YfyFile directUploadFile(long parentId, String name, String filePath) throws YfyException, FileNotFoundException
this#preSignatureUpload(long, String)
and this#uploadFile(String,InputStream) method, direct upload the fileparentId - Parent folder id you want to store the file in, the root folder is 0name - File namefilePath - Path of the file which you'd like to upload to serverYfyExceptionFileNotFoundExceptionpublic YfyFile directUploadFile(long parentId, String name, InputStream fileStream) throws YfyException
this#preSignatureUpload(long, String)
and this#uploadFile(String,InputStream) method, direct upload the fileparentId - Parent folder id you want to store the file in, the root folder is 0name - File namefileStream - The file stream which you'd like to upload to serverYfyExceptionpublic YfyFile directUploadNewVersionFile(long fileId, String name, String remark, String filePath) throws YfyException, FileNotFoundException
this#newVersionPreSignatureUpload(long,String,String)
and this#uploadFile(String,InputStream) method, direct upload the new version filefileId - File id that you want to upload the new version toname - New version file nameremark - Remark of the new versionfilePath - Path of the file which you'd like to upload to serverYfyExceptionFileNotFoundExceptionpublic YfyFile directUploadNewVersionFile(long fileId, String name, String remark, InputStream fileStream) throws YfyException
this#newVersionPreSignatureUpload(long,String,String)
and this#uploadFile(String,InputStream) method, direct upload the new version filefileId - File id that you want to upload the new version toname - New version file nameremark - Remark of the new versionfileStream - The file stream which you'd like to upload to serverYfyExceptionpublic PreviewResult preview(long fileId, PreviewKindEnum previewKind, boolean forceRegenerate) throws YfyException
fileId - File id in fangcloudpreviewKind - The kinds of preview, see PreviewKindEnumforceRegenerate - if true, the preview image will regenerate forceYfyExceptionpublic DownloadPreviewResult downloadPreview(long fileId, int pageIndex, PreviewKindEnum previewKind) throws YfyException
this#preview(long,PreviewKindEnum,boolean) more
than 1. Notice this interface will not trigger preview transform.fileId - File id in fangcloudpageIndex - Less than the page count return by this#preview(long,PreviewKindEnum,boolean)previewKind - The kinds of preview, see PreviewKindEnumthis#preview(long,PreviewKindEnum,boolean) beforeYfyExceptionpublic YfyFile copyFile(long fileId, long targetFolderId) throws YfyException
fileId - File id in fangcloudtargetFolderId - Id of the destination folder in fangcloudYfyExceptionpublic ListShareLinkResult listShareLink(long fileId, int pageId) throws YfyException
fileId - File id in fangcloudpageId - Page id begin with 0YfyExceptionpublic ListShareLinkResult listShareLink(long fileId, int pageId, long ownerId) throws YfyException
fileId - File id in fangcloudpageId - Page id begin with 0ownerId - Owner id of share link you want to seeYfyExceptionpublic ListCommentResult listComment(long fileId) throws YfyException
fileId - File id in fangcloudYfyExceptionCopyright © 2018 YiFangYun. All rights reserved.