Exemple #1
0
        public BackgroundUpload([NotNull] string fullPath, [NotNull] string parentId, [NotNull] string name, [NotNull] ITemporaryData tempData, [NotNull] OneDriveFileSystem fileSystem)
        {
            TransferId  = fullPath;
            ParentId    = parentId;
            Name        = name;
            _tempData   = tempData;
            _fileSystem = fileSystem;
            var now = DateTimeOffset.Now;

            Item = new Item
            {
                Name = Name,
                Size = _tempData.Size,
                LastModifiedDateTime = now,
                CreatedDateTime      = now,
                ParentReference      = new ItemReference
                {
                    Id = ParentId,
                },
                Folder = new Folder()
                {
                    ChildCount = 0
                },
            };
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundUpload"/> class.
 /// </summary>
 /// <param name="fullPath">The full path to this item</param>
 /// <param name="file">The file to upload to</param>
 /// <param name="tempData">The temporary data used to read from</param>
 /// <param name="fileSystem">The file system that initiated this background upload</param>
 public BackgroundUpload([NotNull] string fullPath, [NotNull] File file, [NotNull] ITemporaryData tempData, [NotNull] GoogleDriveFileSystem fileSystem)
 {
     TransferId = fullPath;
     File = file;
     _tempData = tempData;
     _fileSystem = fileSystem;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundUpload"/> class.
 /// </summary>
 /// <param name="fullPath">The full path to this item</param>
 /// <param name="file">The file to upload to</param>
 /// <param name="tempData">The temporary data used to read from</param>
 /// <param name="fileSystem">The file system that initiated this background upload</param>
 public BackgroundUpload([NotNull] string fullPath, [NotNull] File file, [NotNull] ITemporaryData tempData, [NotNull] GoogleDriveFileSystem fileSystem)
 {
     TransferId  = fullPath;
     File        = file;
     _tempData   = tempData;
     _fileSystem = fileSystem;
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackgroundUpload"/> class.
 /// </summary>
 /// <param name="fullPath">The full path to this item.</param>
 /// <param name="file">The file to upload to.</param>
 /// <param name="tempData">The temporary data used to read from.</param>
 /// <param name="fileSystem">The file system that initiated this background upload.</param>
 public BackgroundUpload(
     string fullPath,
     File file,
     ITemporaryData tempData,
     IGoogleDriveFileSystem fileSystem)
 {
     TransferId  = fullPath;
     File        = file;
     _tempData   = tempData;
     _fileSystem = fileSystem;
 }
Exemple #5
0
 public BackgroundUpload([NotNull] string fullPath, [NotNull] string parentId, [NotNull] string name, [NotNull] ITemporaryData tempData, [NotNull] OneDriveFileSystem fileSystem)
 {
     TransferId = fullPath;
     ParentId = parentId;
     Name = name;
     _tempData = tempData;
     _fileSystem = fileSystem;
     var now = DateTimeOffset.Now;
     Item = new Item
     {
         Name = Name,
         Size = _tempData.Size,
         LastModifiedDateTime = now,
         CreatedDateTime = now,
         ParentReference = new ItemReference
         {
             Id = ParentId,
         },
         Folder = new Folder() { ChildCount = 0 },
     };
 }