public UploadInfo(string url, string httpMethod, IEnumerable <KeyValuePair <string, string> > httpHeaders, IUploadIdentifier uploadIdentifier) { URL = url; HttpMethod = httpMethod; HttpHeaders = httpHeaders; UploadIdentifier = uploadIdentifier; }
public MultiPartUploadInfo(string httpMethod, long partSize, IEnumerable <IHttpPartUploadInfo> partUploadInfos, string multiPartUploadResultHeaderName, IUploadIdentifier uploadIdentifier) { HttpMethod = httpMethod; PartSize = partSize; PartUploadInfos = partUploadInfos; MultiPartUploadResultHeaderName = multiPartUploadResultHeaderName; UploadIdentifier = uploadIdentifier; }
public async Task <IDocumentIdentifier> CommitMultiPartUploadAsync(IUploadIdentifier uploadIdentifier, IEnumerable <KeyValuePair <string, string> > partUploadResults) { _authorizationChecker.CheckUserIsInRole(Security.Roles.Operator, Security.Roles.Replicator); var container = GetContainer(); var multiPartUploadContainerContainer = container as IMultiPartUploadContainer; if (multiPartUploadContainerContainer != null) { multiPartUploadContainerContainer.FinalizeMultiPartUpload(uploadIdentifier.HostIdentifier, partUploadResults); } var uncommittedContentIdentifier = _uploadIdentifierProvider.GetUncommittedContentIdentifier(container, uploadIdentifier); var contentIdentifier = await container.CommitContentAsync(uncommittedContentIdentifier); var contentName = _contentNameProvider.GetContentName(contentIdentifier); await PersistCommittedContentNameAsync(contentName, contentIdentifier.ModifiedMoment); return(_documentIdentifierProvider.GetDocumentIdentifier(contentIdentifier)); }
public Task <IDocumentIdentifier> CommitUploadAsync(IUploadIdentifier uploadIdentifier) { _authorizationChecker.CheckUserIsInRole(Security.Roles.Replicator, Security.Roles.Operator); return(CommitMultiPartUploadAsync(uploadIdentifier, null)); }
public IContentIdentifier GetUncommittedContentIdentifier(IContainer container, IUploadIdentifier uploadIdentifier) { return (_contentIdentifiersProvider.GetContentIdentifiers(container, false, uploadIdentifier.Hash) .Where(x => string.Equals(x.Extension, uploadIdentifier.Extension, StringComparison.InvariantCultureIgnoreCase)) .Where(x => string.Equals(x.Guid, uploadIdentifier.Guid, StringComparison.InvariantCultureIgnoreCase)) .FirstOrDefault()); }
public string Serialize(IUploadIdentifier uploadIdentifier) { return(_serializer.Serialize(uploadIdentifier)); }