internal FileBasicMetadata( string checksum, long size, string path, string name, bool locked, string entryId, string groupId, DateTime lastModified, DateTime uploaded, string uploadedBy, int numberOfVersions, FileOrFolderCustomMetadata customMetadata) { Checksum = checksum; Size = size; Path = path; Name = name; Locked = locked; EntryId = entryId; GroupId = groupId; LastModified = lastModified; Uploaded = uploaded; UploadedBy = uploadedBy; NumberOfVersions = numberOfVersions; CustomMetadata = customMetadata ?? new FileOrFolderCustomMetadata(); }
internal FileMetadata( string checksum, long size, string path, string name, bool locked, string entryId, string groupId, DateTime lastModified, DateTime uploaded, string uploadedBy, int numberOfVersions, List <FileVersionMetadata> versions, FileOrFolderCustomMetadata customMetadata) : base( checksum, size, path, name, locked, entryId, groupId, lastModified, uploaded, uploadedBy, numberOfVersions, customMetadata) { Versions = versions; }
internal FolderExtendedMetadata( string name, int count, int offset, string path, string folderId, int totalCount, DateTime lastModified, bool restrictMoveDelete, string publicLinks, string[] allowedFileLinkTypes, string[] allowedFolderLinkTypes, List <FolderMetadata> folders, List <FileBasicMetadata> files, FileOrFolderCustomMetadata customMetadata) : base(name, lastModified, path, folderId, allowedFileLinkTypes, allowedFolderLinkTypes, customMetadata) { Count = count; Offset = offset; TotalCount = totalCount; RestrictMoveDelete = restrictMoveDelete; PublicLinks = publicLinks; Folders = folders ?? new List <FolderMetadata>(); Files = files ?? new List <FileBasicMetadata>(); }
internal static FileOrFolderMetadata MapResponseToMetadata(ListFileOrFolderResponse response) { var customMetadata = new FileOrFolderCustomMetadata(); if (response.CustomMetadata != null) { customMetadata.AddRange(response.CustomMetadata); } if (response.IsFolder) { return(new FileOrFolderMetadata( true, new FolderExtendedMetadata( response.Name, response.Count, response.Offset, response.Path, response.FolderId, response.TotalCount, ConvertFromUnixTimestamp(response.LastModifiedFolder), response.RestrictMoveDelete, response.PublicLinks, response.AllowedFileLinkTypes, response.AllowedFolderLinkTypes, MapChildFoldersResponse(response.Folders), MapChildFilesResponse(response.Files), customMetadata))); } return(new FileOrFolderMetadata( false, null, new FileMetadata( response.Checksum, response.Size, response.Path, response.Name, response.Locked, response.EntryId, response.GroupId, response.LastModifiedFile, response.Uploaded, response.UploadedBy, response.NumberOfVersions, MapFileVersions(response.Versions), customMetadata))); }
internal FolderMetadata( string name, DateTime lastModified, string path, string folderId, string[] allowedFileLinkTypes, string[] allowedFolderLinkTypes, FileOrFolderCustomMetadata customMetadata) { Name = name; LastModified = lastModified; Path = path; FolderId = folderId; AllowedFileLinkTypes = allowedFileLinkTypes ?? new string[0]; AllowedFolderLinkTypes = allowedFolderLinkTypes ?? new string[0]; CustomMetadata = customMetadata ?? new FileOrFolderCustomMetadata(); }