[jboss-cvs] JBossAS SVN: r75115 - projects/vfs/trunk/src/main/java/org/jboss/virtual.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 26 09:57:02 EDT 2008


Author: alesj
Date: 2008-06-26 09:57:02 -0400 (Thu, 26 Jun 2008)
New Revision: 75115

Modified:
   projects/vfs/trunk/src/main/java/org/jboss/virtual/VFSUtils.java
Log:
[JBVFS-40]; add new enable/disable utils.

Modified: projects/vfs/trunk/src/main/java/org/jboss/virtual/VFSUtils.java
===================================================================
--- projects/vfs/trunk/src/main/java/org/jboss/virtual/VFSUtils.java	2008-06-26 13:11:34 UTC (rev 75114)
+++ projects/vfs/trunk/src/main/java/org/jboss/virtual/VFSUtils.java	2008-06-26 13:57:02 UTC (rev 75115)
@@ -478,34 +478,96 @@
    }
 
    /**
-    * Enable copy for file param.
+    * Enable option.
     *
     * @param file the file
+    * @param optionName option name
     */
-   public static void enableCopy(VirtualFile file)
+   protected static void enableOption(VirtualFile file, String optionName)
    {
       Map<String, String> options = getOptions(file);
       if (options == null)
-         throw new IllegalArgumentException("Cannot enable copy on null options: " + file);
+         throw new IllegalArgumentException("Cannot enable " + optionName + " on null options: " + file);
 
-      options.put(USE_COPY_QUERY, Boolean.TRUE.toString());
+      options.put(optionName, Boolean.TRUE.toString());
    }
 
    /**
-    * Disable copy for file param.
+    * Disable option.
     *
     * @param file the file
+    * @param optionName option name
     */
-   public static void disableCopy(VirtualFile file)
+   protected static void disableOption(VirtualFile file, String optionName)
    {
       Map<String, String> options = getOptions(file);
       if (options == null)
-         throw new IllegalArgumentException("Cannot disable copy on null options: " + file);
+         throw new IllegalArgumentException("Cannot disable " + optionName + " on null options: " + file);
 
-      options.remove(USE_COPY_QUERY);
+      options.remove(optionName);
    }
 
    /**
+    * Enable copy for file param.
+    *
+    * @param file the file
+    */
+   public static void enableCopy(VirtualFile file)
+   {
+      enableOption(file, USE_COPY_QUERY);
+   }
+
+   /**
+    * Disable copy for file param.
+    *
+    * @param file the file
+    */
+   public static void disableCopy(VirtualFile file)
+   {
+      disableOption(file, USE_COPY_QUERY);
+   }
+
+   /**
+    * Enable repaer for file param.
+    *
+    * @param file the file
+    */
+   public static void enableNoReaper(VirtualFile file)
+   {
+      enableOption(file, NO_REAPER_QUERY);
+   }
+
+   /**
+    * Disable reaper for file param.
+    *
+    * @param file the file
+    */
+   public static void disableNoReaper(VirtualFile file)
+   {
+      disableOption(file, NO_REAPER_QUERY);
+   }
+
+   /**
+    * Enable case sensitive for file param.
+    *
+    * @param file the file
+    */
+   public static void enableCaseSensitive(VirtualFile file)
+   {
+      enableOption(file, CASE_SENSITIVE_QUERY);
+   }
+
+   /**
+    * Disable case sensitive for file param.
+    *
+    * @param file the file
+    */
+   public static void disableCaseSensitive(VirtualFile file)
+   {
+      disableOption(file, CASE_SENSITIVE_QUERY);
+   }
+
+   /**
     * Unpack the nested artifact under file param.
     *
     * @param file the file to unpack




More information about the jboss-cvs-commits mailing list