private static List<RemoteFile> GetVersionsOrderByLastModified(File SQObject) { return RemoteRepo.TrashFiles.Where (ft => ft.AbsolutePath.Contains ( SQObject.AbsolutePath)).OrderBy(ft => ft.AsS3Object.LastModified).ToList<RemoteFile>(); }
public Change(File file, System.IO.WatcherChangeTypes changeEvent) { File = file; Event = changeEvent; }
public static void Upload(File file) { connection.Upload(file); }
public static void UpdateTrashFolder(File SQObject) { if ( SQObject.IsAFolder) return; List<RemoteFile> versions = GetVersionsOrderByLastModified ( SQObject); foreach (RemoteFile version in versions) { //if (version.IsAFolder) // continue; //Console.WriteLine ("Incrementa versao"); string newName = ""; string oldName = version.FullLocalName; int sizeOldName = oldName.Length; int v = int.Parse(oldName[sizeOldName-2].ToString())+1; newName = oldName.Substring (0, sizeOldName - 3) +"("+v+")"; connection.CopyInTrash (version, new RemoteFile(newName)); connection.DeleteInTrash (version); } versions = GetVersionsOrderByLastModified ( SQObject); while (versions.Count > 3) { connection.DeleteInTrash (versions.First()); versions = GetVersionsOrderByLastModified( SQObject); } }
public static void MoveToTrash(File SQObject) { connection.CopyToTrash ( SQObject); UpdateTrashFolder ( SQObject); connection.Delete ( SQObject); }
public static void Move(File old, File newO) { connection.Copy (old, newO); connection.CopyToTrash (old); if (RemoteRepo.Files.Where (rf => rf.Name == old.Name).Any()) connection.Delete (old); }
public static bool ExistsInBucket(File file) { return Files.Where (rf => rf.AbsolutePath == file.AbsolutePath || rf.AbsolutePath.Contains (file.AbsolutePath)).Any (); }