Exemple #1
0
        public File CopyFile(object fileId, object toFolderId)
        {
            var onedriveFile = GetOneDriveItem(fileId);

            if (onedriveFile is ErrorItem)
            {
                throw new Exception(((ErrorItem)onedriveFile).Error);
            }

            var toOneDriveFolder = GetOneDriveItem(toFolderId);

            if (toOneDriveFolder is ErrorItem)
            {
                throw new Exception(((ErrorItem)toOneDriveFolder).Error);
            }

            var newTitle        = GetAvailableTitle(onedriveFile.Name, toOneDriveFolder.Id, IsExist);
            var newOneDriveFile = OneDriveProviderInfo.Storage.CopyItem(onedriveFile.Id, newTitle, toOneDriveFolder.Id);

            OneDriveProviderInfo.CacheReset(newOneDriveFile.Id);
            OneDriveProviderInfo.CacheReset(toOneDriveFolder.Id);

            return(ToFile(newOneDriveFile));
        }
Exemple #2
0
 public void Dispose()
 {
     OneDriveProviderInfo.Dispose();
 }