Exemplo n.º 1
0
        private static void RemoveFilePermanently(File fileToRemove)
        {
            if (fileToRemove != null)
            {
                SyncService.RemoveFile(fileToRemove.SyncpointId, fileToRemove.LatestVersionId, removePermanently: false);
                SyncService.RemoveFile(fileToRemove.SyncpointId, fileToRemove.LatestVersionId, removePermanently: true);
                return;
            }

            Console.WriteLine("No file to remove.");
        }
Exemplo n.º 2
0
        private static void DeleteTagsForFile(File file)
        {
            try
            {
                Console.WriteLine();
                Console.WriteLine("Start deleting Tags for file...");

                var tags = JsonConvert.DeserializeObject <List <Tag> >(ConfigurationHelper.TagCollection);
                TagService.DeleteTagsForFile(file.SyncpointId, file.FileId, tags);

                Console.WriteLine($"Finished deleting Tags for File {file.Filename} in Syncpoint {file.SyncpointId}.");
            }
            catch (Exception)
            {
                RemoveFilePermanently(file);
                RemoveFolderPermanently();
                throw;
            }
        }
Exemplo n.º 3
0
        private static void GetTagsForFile(File file)
        {
            try
            {
                Console.WriteLine();
                Console.WriteLine("Start getting Tags for file...");

                var tags = TagService.GetTagsForFile(file.SyncpointId, file.FileId);

                Console.WriteLine($"Finished adding Tags to File {file.Filename} in Syncpoint {file.SyncpointId}.");
                Console.WriteLine($"{JsonConvert.SerializeObject(tags)}");
            }
            catch (Exception)
            {
                RemoveFilePermanently(file);
                RemoveFolderPermanently();
                throw;
            }
        }