public CQLFile GetCQLFileFromFileModel(FileModel file)
 => new CQLFile
 {
     Path = file.Path,
     Name = file.Name,
     ExtendedAttributes = FileExtendedAttributesHandler.SerializeExtendedAttributes(file.ExtendedAttributes),
     ModifiedTimestamp  = file.ModifiedTimestamp,
     FilePermissions    = (int)file.FilePermissions,
     GID  = file.GID,
     UID  = file.UID,
     Data = file.Data
 };
Exemple #2
0
        private CQLFile GetCQLFile(FileModel file)
        {
            var cqlFile = new CQLFile
            {
                Path = file.Path,
                Name = file.Name,
                ExtendedAttributes = FileExtendedAttributesHandler.SerializeExtendedAttributes(file.ExtendedAttributes),
                ModifiedTimestamp  = file.ModifiedTimestamp,
                FilePermissions    = (int)file.FilePermissions,
                GID = file.GID,
                UID = file.UID
            };

            if (file.Data.Length > dataBufferSize)
            {
                cqlFile.ContentGuid = file.ContentGUID ?? Guid.NewGuid();
            }
            else
            {
                cqlFile.Data = file.Data;
            }
            return(cqlFile);
        }