DavFile Class

Namespace:
Weavy.Web.WebDAV
Assembly:
Weavy.Web.dll

Represents a file in WebDAV repository.

public class DavFile : DavItem, ILockAsync, IFileAsync, IHierarchyItemAsync, IContentAsync
Inheritance:
System.Object → DavItemDavFile

Constructors

DavFile(DavContext, IEntity, String) Initializes a new instance of the DavFile class.

Properties

ContentLength Gets the size of the file content in bytes.
ContentType Gets the media type of the file.
Etag Gets entity tag - string that identifies current state of resource's content. More information about etags is available here: http://en.wikipedia.org/wiki/HTTP_ETag You can return here either cheksum or hash or counter which increases with every modification.

Methods

CopyToAsync(IItemCollectionAsync, String, Boolean, MultistatusException) Copies this file to another folder.
DeleteAsync(MultistatusException) Deletes this file.
MoveToAsync(IItemCollectionAsync, String, MultistatusException)
ReadAsync(Stream, Int64, Int64) Writes the content of the file to the specified stream.
WriteAsync(Stream, String, Int64, Int64) Saves the content of the file from the specified stream to the WebDAV repository.

Extension Methods

IsNullOrDefault(T) Gets a value indicating if the specified value has the default value of the generic type.
Serialize(Object) Serializes an object, or graph of connected objects, to a byte array.
SerializeToJson(Object, Nullable, JsonSerializerSettings) Serializes an object, or graph of connected objects, to a json string.
IsValid(Object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.