C# 클래스 Box.V2.Managers.BoxFilesManager

File objects represent that metadata about individual files in Box, with attributes describing who created the file, when it was last modified, and other information.
상속: BoxResourceManager
파일 보기 프로젝트 열기: box/box-windows-sdk-v2 1 사용 예제들

공개 메소드들

메소드 설명
ApplyWatermarkAsync ( string id, BoxApplyWatermarkRequest applyWatermarkRequest = null ) : Task

Used to apply or update the watermark for a corresponding Box file.

BoxFilesManager ( IBoxConfig config, IBoxService service, IBoxConverter converter, IAuthRepository auth, string asUser = null, bool suppressNotifications = null ) : Box.V2.Auth
CopyAsync ( Box.V2.Models.BoxFileRequest fileRequest, List fields = null ) : Task

Used to create a copy of a file in another folder. The original version of the file will not be altered.

CreateSharedLinkAsync ( string id, Box.V2.Models.BoxSharedLinkRequest sharedLinkRequest, List fields = null ) : Task

Used to create a shared link for this particular file. Please see here for more information on the permissions available for shared links.

DeleteAsync ( string id, string etag = null ) : Task

Discards a file to the trash. The etag of the file can be included as an ‘If-Match’ header to prevent race conditions. Depending on the enterprise settings for this user, the item will either be immediately and permanently deleted from Box or moved to the trash.

DeleteOldVersionAsync ( string id, string versionId, string etag = null ) : Task

Discards a specific file version to the trash.

DeleteSharedLinkAsync ( string id ) : Task

Used to delete the shared link for this particular file.

DownloadStreamAsync ( string id, string versionId = null, System.TimeSpan timeout = null ) : Task

Returns the stream of the requested file.

GetCommentsAsync ( string id, List fields = null ) : Task>

Retrieves the comments on a particular file, if any exist.

GetDownloadUriAsync ( string id, string versionId = null ) : Task

Retrieves the temporary direct Uri to a file (valid for 15 minutes). This is typically used to send as a redirect to a browser to make the browser download the file directly from Box.

GetFileTasks ( string id, List fields = null ) : Task>

Retrieves all of the tasks for given file.

GetInformationAsync ( string id, List fields = null ) : Task

Retrieves information about a file.

GetLockAsync ( string id ) : Task

Gets a lock file object representation of the lock on the provided file Id (if a lock exists, otherwise returns null).

GetPreviewLinkAsync ( string id ) : Task

Gets a preview link (URI) for a file that is valid for 60 seconds.

GetThumbnailAsync ( string id, int minHeight = null, int minWidth = null, int maxHeight = null, int maxWidth = null, bool throttle = true, bool handleRetry = true ) : Task

Retrieves a thumbnail, or smaller image representation, of this file. Sizes of 32x32, 64x64, 128x128, and 256x256 can be returned in the .png format and sizes of 32x32, 94x94, 160x160, and 320x320 can be returned in the .jpg format. Thumbnails can be generated for the image and video file formats listed here. http://community.box.com/t5/Managing-Your-Content/What-file-types-are-supported-by-Box-s-Content-Preview/ta-p/327

GetTrashedAsync ( string id, List fields = null ) : Task

Retrieves an item that has been moved to the trash.

GetWatermarkAsync ( string id ) : Task

Used to retrieve the watermark for a corresponding Box file.

LockAsync ( BoxFileLockRequest lockFileRequest, string id ) : Task

Used to create a lock on the file.

PreflightCheck ( Box.V2.Models.BoxPreflightCheckRequest preflightCheckRequest ) : Task

Verify that a file will be accepted by Box before you send all the bytes over the wire.

Preflight checks verify all permissions as if the file was actually uploaded including: Folder upload permission File name collisions file size caps folder and file name restrictions* folder and account storage quota

PreflightCheckNewVersion ( string fileId, Box.V2.Models.BoxPreflightCheckRequest preflightCheckRequest ) : Task

Verify that a new version of a file will be accepted by Box before you send all the bytes over the wire.

PromoteVersionAsync ( string id, string versionId ) : Task

If there are previous versions of this file, this method can be used to promote one of the older versions to the top of the stack. This actually mints a copy of the old version and puts it on the top of the versions stack. The file will have the exact same contents, the same SHA1/etag, and the same name as the promoted version. Other properties such as comments do not get updated to their former values.

PurgeTrashedAsync ( string id ) : Task

Permanently deletes an item that is in the trash. The item will no longer exist in Box. This action cannot be undone.

RemoveWatermarkAsync ( string id ) : Task

Used to remove the watermark for a corresponding Box file.

RestoreTrashedAsync ( Box.V2.Models.BoxFileRequest fileRequest, List fields = null ) : Task

Restores an item that has been moved to the trash. Default behavior is to restore the item to the folder it was in before it was moved to the trash. If that parent folder no longer exists or if there is now an item with the same name in that parent folder, the new parent folder and/or new name will need to be included in the request.

UnLock ( string id ) : Task

Remove a lock

UpdateInformationAsync ( Box.V2.Models.BoxFileRequest fileRequest, string etag = null, List fields = null ) : Task

Used to update individual or multiple fields in the file object, including renaming the file, changing it’s description, and creating a shared link for the file. To move a file, change the ID of its parent folder. An optional etag can be included to ensure that client only updates the file if it knows about the latest version.

UpdateLockAsync ( BoxFileLockRequest lockFileRequest, string id ) : Task

Used to update the lock information on the file (for example, ExpiresAt or IsDownloadPrevented.

UploadAsync ( Box.V2.Models.BoxFileRequest fileRequest, Stream stream, List fields = null, System.TimeSpan timeout = null, byte contentMD5 = null, bool setStreamPositionToZero = true, Uri uploadUri = null ) : Task

Uploads a provided file to the target parent folder. If the file already exists, an error will be thrown. A proper timeout should be provided for large uploads.

UploadNewVersionAsync ( string fileName, string fileId, Stream stream, string etag = null, List fields = null, System.TimeSpan timeout = null, byte contentMD5 = null, bool setStreamPositionToZero = true, Uri uploadUri = null ) : Task

This method is used to upload a new version of an existing file in a user’s account. Similar to regular file uploads, these are performed as multipart form uploads. An optional If-Match header can be included to ensure that client only overwrites the file if it knows about the latest version. The filename on Box will remain the same as the previous version. To update the file’s name, you can specify a new name for the file using the fileName parameter. A proper timeout should be provided for large uploads.

ViewVersionsAsync ( string id, List fields = null ) : Task>

If there are previous versions of this file, this method can be used to retrieve metadata about the older versions. Versions are only tracked for Box users with premium accounts.

비공개 메소드들

메소드 설명
GetFilePreviewAsync ( string id, int page, int maxWidth = null, int minWidth = null, int maxHeight = null, int minHeight = null, bool handleRetry = true ) : Task
GetPreviewAsync ( string id, int page, bool handleRetry = true ) : Task
GetPreviewResponseAsync ( string id, int page, int maxWidth = null, int minWidth = null, int maxHeight = null, int minHeight = null, bool handleRetry = true ) : Task>
GetTimeDelay ( HttpResponseHeaders headers ) : int

Return the time to wait until retrying the call. If no RetryAfter value is specified in the header, use default value;

HexStringFromBytes ( byte bytes ) : string

메소드 상세

ApplyWatermarkAsync() 공개 메소드

Used to apply or update the watermark for a corresponding Box file.
public ApplyWatermarkAsync ( string id, BoxApplyWatermarkRequest applyWatermarkRequest = null ) : Task
id string Id of the file.
applyWatermarkRequest Box.V2.Models.BoxApplyWatermarkRequest BoxApplyWatermarkRequest object. Can be null, for using default values - imprint="default"
리턴 Task

BoxFilesManager() 공개 메소드

public BoxFilesManager ( IBoxConfig config, IBoxService service, IBoxConverter converter, IAuthRepository auth, string asUser = null, bool suppressNotifications = null ) : Box.V2.Auth
config IBoxConfig
service IBoxService
converter IBoxConverter
auth IAuthRepository
asUser string
suppressNotifications bool
리턴 Box.V2.Auth

CopyAsync() 공개 메소드

Used to create a copy of a file in another folder. The original version of the file will not be altered.
public CopyAsync ( Box.V2.Models.BoxFileRequest fileRequest, List fields = null ) : Task
fileRequest Box.V2.Models.BoxFileRequest BoxFileRequest object.
fields List Attribute(s) to include in the response.
리턴 Task

CreateSharedLinkAsync() 공개 메소드

Used to create a shared link for this particular file. Please see here for more information on the permissions available for shared links.
public CreateSharedLinkAsync ( string id, Box.V2.Models.BoxSharedLinkRequest sharedLinkRequest, List fields = null ) : Task
id string Id of the file.
sharedLinkRequest Box.V2.Models.BoxSharedLinkRequest BoxSharedLinkRequest object.
fields List Attribute(s) to include in the response.
리턴 Task

DeleteAsync() 공개 메소드

Discards a file to the trash. The etag of the file can be included as an ‘If-Match’ header to prevent race conditions. Depending on the enterprise settings for this user, the item will either be immediately and permanently deleted from Box or moved to the trash.
public DeleteAsync ( string id, string etag = null ) : Task
id string Id of the file.
etag string This ‘etag’ field of the file, which will be set in the If-Match header.
리턴 Task

DeleteOldVersionAsync() 공개 메소드

Discards a specific file version to the trash.
public DeleteOldVersionAsync ( string id, string versionId, string etag = null ) : Task
id string Id of the file (Required).
versionId string Id of the version (Required).
etag string The etag of the file. This is in the ‘etag’ field of the file object.
리턴 Task

DeleteSharedLinkAsync() 공개 메소드

Used to delete the shared link for this particular file.
public DeleteSharedLinkAsync ( string id ) : Task
id string
리턴 Task

DownloadStreamAsync() 공개 메소드

Returns the stream of the requested file.
public DownloadStreamAsync ( string id, string versionId = null, System.TimeSpan timeout = null ) : Task
id string Id of the file to download.
versionId string The ID specific version of this file to download.
timeout System.TimeSpan Optional timeout for response.
리턴 Task

GetCommentsAsync() 공개 메소드

Retrieves the comments on a particular file, if any exist.
public GetCommentsAsync ( string id, List fields = null ) : Task>
id string The Id of the item that the comments should be retrieved for.
fields List Attribute(s) to include in the response.
리턴 Task>

GetDownloadUriAsync() 공개 메소드

Retrieves the temporary direct Uri to a file (valid for 15 minutes). This is typically used to send as a redirect to a browser to make the browser download the file directly from Box.
public GetDownloadUriAsync ( string id, string versionId = null ) : Task
id string Id of the file.
versionId string Version of the file.
리턴 Task

GetFileTasks() 공개 메소드

Retrieves all of the tasks for given file.
public GetFileTasks ( string id, List fields = null ) : Task>
id string Id of the file.
fields List Attribute(s) to include in the response.
리턴 Task>

GetInformationAsync() 공개 메소드

Retrieves information about a file.
public GetInformationAsync ( string id, List fields = null ) : Task
id string Id of the file.
fields List Attribute(s) to include in the response.
리턴 Task

GetLockAsync() 공개 메소드

Gets a lock file object representation of the lock on the provided file Id (if a lock exists, otherwise returns null).
public GetLockAsync ( string id ) : Task
id string Id of the file.
리턴 Task

GetPreviewLinkAsync() 공개 메소드

Gets a preview link (URI) for a file that is valid for 60 seconds.
public GetPreviewLinkAsync ( string id ) : Task
id string Id of the file.
리턴 Task

GetThumbnailAsync() 공개 메소드

Retrieves a thumbnail, or smaller image representation, of this file. Sizes of 32x32, 64x64, 128x128, and 256x256 can be returned in the .png format and sizes of 32x32, 94x94, 160x160, and 320x320 can be returned in the .jpg format. Thumbnails can be generated for the image and video file formats listed here. http://community.box.com/t5/Managing-Your-Content/What-file-types-are-supported-by-Box-s-Content-Preview/ta-p/327
public GetThumbnailAsync ( string id, int minHeight = null, int minWidth = null, int maxHeight = null, int maxWidth = null, bool throttle = true, bool handleRetry = true ) : Task
id string Id of the file.
minHeight int The minimum height of the thumbnail.
minWidth int The minimum width of the thumbnail.
maxHeight int The maximum height of the thumbnail.
maxWidth int The maximum width of the thumbnail.
throttle bool Whether the requests will be throttled. Recommended to be left true to prevent spamming the server.
handleRetry bool Specifies whether the method handles retries. If true, then the method would retry the call if the HTTP response is 'Accepted'. The delay for the retry is determined /// by the RetryAfter header, or if that header is not set, by the constant DefaultRetryDelay.
리턴 Task

GetTrashedAsync() 공개 메소드

Retrieves an item that has been moved to the trash.
public GetTrashedAsync ( string id, List fields = null ) : Task
id string Id of the file.
fields List Attribute(s) to include in the response.
리턴 Task

GetWatermarkAsync() 공개 메소드

Used to retrieve the watermark for a corresponding Box file.
public GetWatermarkAsync ( string id ) : Task
id string Id of the file.
리턴 Task

LockAsync() 공개 메소드

Used to create a lock on the file.
public LockAsync ( BoxFileLockRequest lockFileRequest, string id ) : Task
lockFileRequest Box.V2.Models.BoxFileLockRequest Request contains Lock object for setting of lock properties such as ExpiresAt - the time the lock expires, IsDownloadPrevented - whether or not the file can be downloaded while locked.
id string Id of the file.
리턴 Task

PreflightCheck() 공개 메소드

Verify that a file will be accepted by Box before you send all the bytes over the wire.
Preflight checks verify all permissions as if the file was actually uploaded including: Folder upload permission File name collisions file size caps folder and file name restrictions* folder and account storage quota
public PreflightCheck ( Box.V2.Models.BoxPreflightCheckRequest preflightCheckRequest ) : Task
preflightCheckRequest Box.V2.Models.BoxPreflightCheckRequest BoxPreflightCheckRequest object.
리턴 Task

PreflightCheckNewVersion() 공개 메소드

Verify that a new version of a file will be accepted by Box before you send all the bytes over the wire.
public PreflightCheckNewVersion ( string fileId, Box.V2.Models.BoxPreflightCheckRequest preflightCheckRequest ) : Task
fileId string
preflightCheckRequest Box.V2.Models.BoxPreflightCheckRequest
리턴 Task

PromoteVersionAsync() 공개 메소드

If there are previous versions of this file, this method can be used to promote one of the older versions to the top of the stack. This actually mints a copy of the old version and puts it on the top of the versions stack. The file will have the exact same contents, the same SHA1/etag, and the same name as the promoted version. Other properties such as comments do not get updated to their former values.
public PromoteVersionAsync ( string id, string versionId ) : Task
id string Id of the file (Required).
versionId string Id of the version (Required).
리턴 Task

PurgeTrashedAsync() 공개 메소드

Permanently deletes an item that is in the trash. The item will no longer exist in Box. This action cannot be undone.
public PurgeTrashedAsync ( string id ) : Task
id string Id of the file.
리턴 Task

RemoveWatermarkAsync() 공개 메소드

Used to remove the watermark for a corresponding Box file.
public RemoveWatermarkAsync ( string id ) : Task
id string Id of the file.
리턴 Task

RestoreTrashedAsync() 공개 메소드

Restores an item that has been moved to the trash. Default behavior is to restore the item to the folder it was in before it was moved to the trash. If that parent folder no longer exists or if there is now an item with the same name in that parent folder, the new parent folder and/or new name will need to be included in the request.
public RestoreTrashedAsync ( Box.V2.Models.BoxFileRequest fileRequest, List fields = null ) : Task
fileRequest Box.V2.Models.BoxFileRequest BoxFileRequest object.
fields List Attribute(s) to include in the response.
리턴 Task

UnLock() 공개 메소드

Remove a lock
public UnLock ( string id ) : Task
id string
리턴 Task

UpdateInformationAsync() 공개 메소드

Used to update individual or multiple fields in the file object, including renaming the file, changing it’s description, and creating a shared link for the file. To move a file, change the ID of its parent folder. An optional etag can be included to ensure that client only updates the file if it knows about the latest version.
public UpdateInformationAsync ( Box.V2.Models.BoxFileRequest fileRequest, string etag = null, List fields = null ) : Task
fileRequest Box.V2.Models.BoxFileRequest BoxFileRequest object.
etag string This ‘etag’ field of the file, which will be set in the If-Match header.
fields List Attribute(s) to include in the response.
리턴 Task

UpdateLockAsync() 공개 메소드

Used to update the lock information on the file (for example, ExpiresAt or IsDownloadPrevented.
public UpdateLockAsync ( BoxFileLockRequest lockFileRequest, string id ) : Task
lockFileRequest Box.V2.Models.BoxFileLockRequest BoxFileLockRequest object.
id string Id of the file.
리턴 Task

UploadAsync() 공개 메소드

Uploads a provided file to the target parent folder. If the file already exists, an error will be thrown. A proper timeout should be provided for large uploads.
public UploadAsync ( Box.V2.Models.BoxFileRequest fileRequest, Stream stream, List fields = null, System.TimeSpan timeout = null, byte contentMD5 = null, bool setStreamPositionToZero = true, Uri uploadUri = null ) : Task
fileRequest Box.V2.Models.BoxFileRequest BoxFileRequest object.
stream Stream Stream of uploading file.
fields List Fields which shall be returned in result.
timeout System.TimeSpan Timeout for response.
contentMD5 byte The SHA1 hash of the file.
setStreamPositionToZero bool Set position for input stream to 0.
uploadUri System.Uri Uri to use for upload. Default upload endpoint URI is used if not specified.
리턴 Task

UploadNewVersionAsync() 공개 메소드

This method is used to upload a new version of an existing file in a user’s account. Similar to regular file uploads, these are performed as multipart form uploads. An optional If-Match header can be included to ensure that client only overwrites the file if it knows about the latest version. The filename on Box will remain the same as the previous version. To update the file’s name, you can specify a new name for the file using the fileName parameter. A proper timeout should be provided for large uploads.
public UploadNewVersionAsync ( string fileName, string fileId, Stream stream, string etag = null, List fields = null, System.TimeSpan timeout = null, byte contentMD5 = null, bool setStreamPositionToZero = true, Uri uploadUri = null ) : Task
fileName string Name of the file.
fileId string Id of the file to upload a new version to.
stream Stream Stream of the uploading file.
etag string This ‘etag’ field of the file, which will be set in the If-Match header.
fields List Fields which shall be returned in result.
timeout System.TimeSpan Optional timeout for response.
contentMD5 byte The SHA1 hash of the file.
setStreamPositionToZero bool Set position for input stream to 0.
uploadUri System.Uri Optional url for uploading file.
리턴 Task

ViewVersionsAsync() 공개 메소드

If there are previous versions of this file, this method can be used to retrieve metadata about the older versions. Versions are only tracked for Box users with premium accounts.
public ViewVersionsAsync ( string id, List fields = null ) : Task>
id string The file id.
fields List Attribute(s) to include in the response.
리턴 Task>