Author: slotia
Date: 2012-07-02 17:08:14 -0700 (Mon, 02 Jul 2012)
New Revision: 29739

Modified:
   core3/impl/trunk/app-impl/api-notes.txt
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
Log:
Added creation of disabled category of apps

Modified: core3/impl/trunk/app-impl/api-notes.txt
===================================================================
--- core3/impl/trunk/app-impl/api-notes.txt     2012-07-02 22:32:10 UTC (rev 
29738)
+++ core3/impl/trunk/app-impl/api-notes.txt     2012-07-03 00:08:14 UTC (rev 
29739)
@@ -9,7 +9,7 @@
 
 GET  http://127.0.0.1:2608/status?appname=<app_name>
 
-Notes: App_name is the app store unique app name. For web-downloaded apps, it 
will be the same 
+Notes: App_name is the full app name. For web-downloaded apps, it will be the 
same 
 as the Cytoscape-App-Name entry in the manifest.
 
 Response

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
  2012-07-02 22:32:10 UTC (rev 29738)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
  2012-07-03 00:08:14 UTC (rev 29739)
@@ -51,12 +51,15 @@
         */
        private static final String[] APP_EXTENSIONS = {"jar", "kar"};
        
-       /** Installed apps are copied to this subdirectory under the local app 
storage directory. */
+       /** Installed apps are moved to this subdirectory under the local app 
storage directory. */
        private static final String INSTALLED_APPS_DIRECTORY_NAME = "installed";
        
-       /** Uninstalled apps are copied to this subdirectory under the local 
app storage directory. */
+       /** Uninstalled apps are moved to this subdirectory under the local app 
storage directory. */
        private static final String UNINSTALLED_APPS_DIRECTORY_NAME = 
"uninstalled";
        
+       /** Disabled apps are moved to this subdirectory under the local app 
storage directory. */
+       private static final String DISABLED_APPS_DIRECTORY_NAME = "disabled";
+       
        /** Apps are downloaded from the web store to this subdirectory under 
local app storage directory. */
        private static final String DOWNLOADED_APPS_DIRECTORY_NAME = 
"download-temp";
        
@@ -166,7 +169,7 @@
        private void setupAlterationMonitor() {
                // Set up the FileAlterationMonitor to install/uninstall apps 
when apps are moved in/out of the 
                // installed/uninstalled app directories
-               fileAlterationMonitor = new FileAlterationMonitor(600);
+               fileAlterationMonitor = new FileAlterationMonitor(30000L);
                
                File installedAppsPath = new File(getInstalledAppsPath());
                
@@ -450,6 +453,27 @@
                        return path.getAbsolutePath();
                }
        }
+       
+       /**
+        * Return the canonical path of the subdirectory in the local storage 
directory containing disabled apps.
+        * @return The canonical path of the subdirectory in the local storage 
directory containing disabled apps,
+        * or <code>null</code> if there was an error obtaining the canonical 
path.
+        */
+       public String getDisabledAppsPath() {
+               File path = new File(getBaseAppPath() + File.separator + 
DISABLED_APPS_DIRECTORY_NAME);
+               
+               try {
+                       // Create the directory if it doesn't exist     
+                       if (!path.exists()) {
+                               path.mkdirs();
+                       }
+                       
+                       return path.getCanonicalPath();
+               } catch (IOException e) {
+                       logger.warn("Failed to obtain path to disabled apps 
directory");
+                       return path.getAbsolutePath();
+               }
+       }
 
        /**
         * Return the canonical path of the temporary directory in the local 
storage directory used to contain apps that
@@ -657,6 +681,12 @@
                        logger.info("Creating " + installedDirectory + ". 
Success? " + created);
                }
                
+               File disabledDirectory = new File(getDisabledAppsPath());
+               if (!disabledDirectory.exists()) {
+                       created = created && disabledDirectory.mkdirs();
+                       logger.info("Creating " + disabledDirectory + ". 
Success? " + created);
+               }
+               
                File temporaryInstallDirectory = new 
File(getTemporaryInstallPath());
                if (!temporaryInstallDirectory.exists()) {
                        created = created && temporaryInstallDirectory.mkdirs();

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to