Disable paste option if the target folder is a child of the folder to-be-copied
[pithos] / web_client / src / gr / grnet / pithos / web / client / foldertree / Folder.java
index 7709033..3888d1e 100644 (file)
@@ -327,4 +327,11 @@ public class Folder extends Resource {
        public boolean isHome() {
                return isContainer() && name.equals(Pithos.HOME_CONTAINER);
        }
+
+       public boolean contains(Folder folder) {
+               for (Folder f : subfolders)
+                       if (f.equals(folder) || f.contains(folder))
+                               return true;
+               return false;
+       }
 }