Click or drag to resize

IFileAsync Interface

IT Hit WebDAV Classes Reference
Represents a file on a WebDAV server.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 2.0.420.0
Syntax
public interface IFileAsync : IItemContentAsync, 
	IHierarchyItemAsync, IConnectionSettingsAsync

The IFileAsync type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleActiveLocks
Array of item's lock descriptions.
(Inherited from IHierarchyItemAsync.)
Public propertyAllowWriteStreamBuffering
Gets or sets a value that indicates whether to buffer the data sent to server.
(Inherited from IConnectionSettingsAsync.)
Public propertyCode exampleCheckedOut
Provides information whether item is in checked-in or checked-out state.
Public propertyCode exampleContentLength
Length of the file content.
(Inherited from IItemContentAsync.)
Public propertyContentType
Content type of the file.
(Inherited from IItemContentAsync.)
Public propertyCreationDate
The date item was created.
(Inherited from IHierarchyItemAsync.)
Public propertyDisplayName
User friendly item name.
(Inherited from IHierarchyItemAsync.)
Public propertyEtag
Gets entity tag - string that identifies current state of file's content.
(Inherited from IItemContentAsync.)
Public propertyHref
This item path on the server.
(Inherited from IHierarchyItemAsync.)
Public propertyItemType
Type of the item (File, Folder, Version or VersionHistory)
(Inherited from IHierarchyItemAsync.)
Public propertyLastModified
Most recent modification date.
(Inherited from IHierarchyItemAsync.)
Public propertyCode exampleProperties (Inherited from IHierarchyItemAsync.)
Public propertyResumableUpload
Returns instance of IResumableUploadAsync to manage partially failed uploads.
(Inherited from IItemContentAsync.)
Public propertySendChunked
Gets or sets a value that indicates whether to send data in segments.
(Inherited from IConnectionSettingsAsync.)
Public propertySupportedLock
Lock types supported by the item.
(Inherited from IHierarchyItemAsync.)
Public propertyTimeOut
Sets and gets time-out in milliseconds.
(Inherited from IConnectionSettingsAsync.)
Public propertyCode exampleVersionControlled
Provides information whether item is under version control.
Top
Methods
  NameDescription
Public methodCode exampleCheckInAsync
Creates new version.
Public methodCode exampleCheckInAsync(String)
Creates new version.
Public methodCode exampleCheckOutAsync
Allow modifications to the content and custom properties of this version-controlled resource.
Public methodCode exampleCheckOutAsync(String)
Allow modifications to the content and custom properties of this version-controlled file.
Public methodCode exampleCopyToAsync(IFolderAsync, String, Boolean, Boolean)
Copies this item to destination folder.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleCopyToAsync(IFolderAsync, String, Boolean, Boolean, LockUriTokenPair)
Copies this item to destination folder.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleDeleteAsync
Deletes this item.
(Inherited from IHierarchyItemAsync.)
Public methodDeleteAsync(String)
Deletes this item.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleDeleteAsync(LockUriTokenPair)
Deletes this item.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleDownloadAsync
Downloads content of the file to a file specified by filename
(Inherited from IItemContentAsync.)
Public methodCode exampleGetActiveLocksAsync Obsolete.
Retrieves lock information about this item.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleGetAllPropertiesAsync
Retrieves all custom properties exposed by the item.
(Inherited from IHierarchyItemAsync.)
Public methodGetAutoVersionAsync
Determines how checked-in item responds to WebDAV client attempts to modify its content or properties.
Public methodGetCommentAsync
Brief comment about an item that is suitable for presentation to a user.
(Inherited from IHierarchyItemAsync.)
Public methodGetCreatorDisplayNameAsync
Contains a description of the creator of the item that is suitable for presentation to a user.
(Inherited from IHierarchyItemAsync.)
Public methodGetCurrentVersionAsync
Current item version. Null, if item is not under version control.
Public methodCode exampleGetParentAsync
Retrieves parent hierarchy item of this item.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleGetPropertyNamesAsync
Returns names of all custom properties exposed by this item.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleGetPropertyValuesAsync
Retrieves values of specific properties.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleGetReadStreamAsync
Loads content of the file from WebDAV server.
(Inherited from IItemContentAsync.)
Public methodGetReadStreamAsync(Int64, Int64)
Loads part of the content of the file from WebDAV server.
(Inherited from IItemContentAsync.)
Public methodCode exampleGetReadStreamAsync(Int64, Int64, DateTime)
Loads part of the content of the file from WebDAV server using lastModifiedUtc to ensure the content is up-to-date.
(Inherited from IItemContentAsync.)
Public methodCode exampleGetReadStreamAsync(Int64, Int64, String)
Loads part of the content of the file from WebDAV server using eTag to ensure the content is up-to-date.
(Inherited from IItemContentAsync.)
Public methodGetSourceAsync
Retrieves media type independent links.
(Inherited from IHierarchyItemAsync.)
Public methodGetSupportedLockAsync Obsolete.
Retrieves information about supported locks.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleGetVersionsAsync
Retrieves list of all versions for this file.
Public methodCode exampleGetWriteStreamAsync(Int64)
Saves file's content to WebDAV server.
(Inherited from IItemContentAsync.)
Public methodCode exampleGetWriteStreamAsync(String, Int64)
Saves file's content to WebDAV server.
(Inherited from IItemContentAsync.)
Public methodCode exampleGetWriteStreamAsync(String, Int64, String)
Saves files's content to WebDAV server.
(Inherited from IItemContentAsync.)
Public methodCode exampleIsCheckedOutAsync Obsolete.
Determines whether item is in checked-in or checked-out state.
Public methodCode exampleIsVersionControlledAsync Obsolete.
Determines whether item is under version control.
Public methodCode exampleLockAsync
Locks the item.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleMoveToAsync(IFolderAsync, String, Boolean)
Moves this item to another location.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleMoveToAsync(IFolderAsync, String, Boolean, LockUriTokenPair)
Moves this item to another location.
(Inherited from IHierarchyItemAsync.)
Public methodCode examplePutUnderVersionControlAsync(Boolean)
Enables / disables version control for this file.
Public methodPutUnderVersionControlAsync(Boolean, String)
Enables / disables version control for this file.
Public methodCode exampleRefreshAsync
Rereads item properties from server.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleRefreshLockAsync
Prolongs the lock.
(Inherited from IHierarchyItemAsync.)
Public methodSetAutoVersionAsync(AutoVersion)
Sets how checked-in item responds to WebDAV client attempts to modify its content or properties.
Public methodSetAutoVersionAsync(AutoVersion, String)
Sets how checked-in item responds to WebDAV client attempts to modify its content or properties.
Public methodCode exampleSetCommentAndAuthorAsync(String, String)
Updates comment and author information.
(Inherited from IHierarchyItemAsync.)
Public methodSetCommentAndAuthorAsync(String, String, String)
Updates comment and author information.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleSupportedFeaturesAsync
Gets the information about functionality supported by server (Class 1, Class 2 and so on).
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleUnCheckOutAsync
Cancels the CHECKOUT and restore the pre-CHECKOUT state of the version-controlled file.
Public methodCode exampleUnCheckOutAsync(String)
Cancels the CHECKOUT and restore the pre-CHECKOUT state of the version-controlled resource.
Public methodCode exampleUnlockAsync
Removes the lock.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleUpdatePropertiesAsync(Property, PropertyName)
Updates values of properties exposed by this item.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleUpdatePropertiesAsync(Property, PropertyName, String)
Updates values of properties exposed by this item.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleUpdateToVersionAsync(IVersionAsync)
Updates content and dead properties of item to those identified by version.
Public methodCode exampleUpdateToVersionAsync(IVersionAsync, String)
Updates content and dead properties of item to those identified by version.
Public methodCode exampleUploadAsync(String)
Uploads content of a file specified by filename to the server
(Inherited from IItemContentAsync.)
Public methodCode exampleUploadAsync(String, String)
Uploads content of a file specified by filename to the server
(Inherited from IItemContentAsync.)
Top
Examples
In the following example a file is downloaded from a WebDAV server.
string license = "<?xml version='1.0' encoding='utf...
WebDavSessionAsync session = new WebDavSessionAsync(license);
session.Credentials = new NetworkCredential("User1", "pwd");

IFileAsync file = await session.OpenFileAsync("http://server:8080/Products/image.gif");
file.TimeOut = 36000000; // 10 hours
using (Stream webStream = await file.GetReadStreamAsync())
{
    int bufSize = 1048576; // 1Mb
    byte[] buffer = new byte[bufSize];
    int bytesRead = 0;
    using (FileStream fileStream = File.OpenWrite(file.DisplayName))
    {
        while ((bytesRead = await webStream.ReadAsync(buffer, 0, bufSize)) > 0)
            await fileStream.WriteAsync(buffer, 0, bytesRead);
    }
}
See Also