Author: paperwing
Date: 2012-06-13 15:49:47 -0700 (Wed, 13 Jun 2012)
New Revision: 29555

Modified:
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppParser.java
Log:
App Manager now accepts the minimum Cytoscape version from the jar manifest 
from the key "Cytoscape-App-Compatibility" as suggested

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppParser.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppParser.java
   2012-06-13 19:50:12 UTC (rev 29554)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppParser.java
   2012-06-13 22:49:47 UTC (rev 29555)
@@ -36,9 +36,15 @@
         * The name of the key in the app jar's manifest file indicating the 
major versions of
         * Cytoscape that the app is known to be compatible with in 
comma-delimited form
         */
-       private static final String APP_COMPATIBLE_TAG = 
"Cytoscape-App-Works-With";
+       private static final String APP_COMPATIBLE_TAG = 
"Cytoscape-App-Compatibility";
        
        /**
+        * An alternative name of the key in the app jar's manifest file 
indicating the major versions of
+        * Cytoscape that the app is known to be compatible with
+        */
+       private static final String APP_COMPATIBLE_ALTERNATIVE_TAG = 
"Cytoscape-App-Works-With";
+
+       /**
         * A regular expression representing valid app versions, which are in 
the format major.minor[.patch][-tag],
         * eg. 3.0.0-SNAPSHOT, or 3.0.
         */
@@ -114,13 +120,22 @@
                
                String compatibleVersions = 
manifest.getMainAttributes().getValue(APP_COMPATIBLE_TAG);
                if (compatibleVersions == null || 
compatibleVersions.trim().length() == 0) {
-                       throw new AppParsingException("Jar is missing value for 
entry " + APP_COMPATIBLE_TAG + " in its manifest file.");
+                       compatibleVersions = 
manifest.getMainAttributes().getValue(APP_COMPATIBLE_ALTERNATIVE_TAG);
+                       
+                       if (compatibleVersions == null || 
compatibleVersions.trim().length() == 0) {
+                               throw new AppParsingException("Jar is missing 
value for entry " + APP_COMPATIBLE_TAG + " in its manifest file.");
+                       } else if 
(!compatibleVersions.matches(APP_COMPATIBLE_TAG_REGEX)) {
+                               throw new AppParsingException("The known 
compatible versions of Cytoscape specified in the manifest under the"
+                                               + " key " + 
APP_COMPATIBLE_ALTERNATIVE_TAG + " does not match the form of a comma-delimited 
list of"
+                                               + " versions of the form 
major[.minor] (eg. 1 or 1.0) with variable whitespace around versions");
+                       }
                } else if 
(!compatibleVersions.matches(APP_COMPATIBLE_TAG_REGEX)) {
                        throw new AppParsingException("The known compatible 
versions of Cytoscape specified in the manifest under the"
                                        + " key " + APP_COMPATIBLE_TAG + " does 
not match the form of a comma-delimited list of versions of the form"
                                        + " major[.minor] (eg. 1 or 1.0) with 
variable whitespace around versions");
                }
                
+               
                parsedApp.setAppFile(file);
                parsedApp.setEntryClassName(entryClassName);
                parsedApp.setAppName(readableName);

-- 
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