You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2013/01/15 22:01:01 UTC

svn commit: r1433647 - in /chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench: ClientFrame.java ClientHelper.java

Author: fmui
Date: Tue Jan 15 21:01:01 2013
New Revision: 1433647

URL: http://svn.apache.org/viewvc?rev=1433647&view=rev
Log:
CMIS-620: fixed scripts dropbox

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientFrame.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientFrame.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientFrame.java?rev=1433647&r1=1433646&r2=1433647&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientFrame.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientFrame.java Tue Jan 15 21:01:01 2013
@@ -405,7 +405,7 @@ public class ClientFrame extends JFrame 
 
         List<FileEntry> result = ClientHelper.readFileProperties(propFile);
 
-        if (result == null) {
+        if (result == null || result.isEmpty()) {
             result = Collections.singletonList(new FileEntry("Groovy Console", null));
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java?rev=1433647&r1=1433646&r2=1433647&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java Tue Jan 15 21:01:01 2013
@@ -549,7 +549,7 @@ public class ClientHelper {
                 return null;
             }
         } catch (Exception e) {
-            e.printStackTrace();
+            LOG.error("Cannot open library file: " + propertiesFile, e);
             return null;
         }
 
@@ -562,6 +562,18 @@ public class ClientHelper {
             }
         }
 
+        if ("jar".equalsIgnoreCase(propertiesFile.getScheme())) {
+            String path = propertiesFile.getSchemeSpecificPart();
+            int x = path.lastIndexOf('/');
+            if (x > -1) {
+                path = path.substring(0, x);
+                x = path.indexOf("!/");
+                if (x > -1) {
+                    classpathParent = path.substring(x + 1);
+                }
+            }
+        }
+
         String fileParent = null;
         if ("file".equalsIgnoreCase(propertiesFile.getScheme())) {
             fileParent = (new File(propertiesFile)).getParent();
@@ -579,7 +591,10 @@ public class ClientHelper {
                     URI uri = null;
 
                     if (classpathParent != null) {
-                        uri = ClientHelper.class.getResource(classpathParent + "/" + file).toURI();
+                        URL url = ClientHelper.class.getResource(classpathParent + "/" + file);
+                        if (url != null) {
+                            uri = url.toURI();
+                        }
                     }
 
                     if (fileParent != null) {
@@ -588,6 +603,8 @@ public class ClientHelper {
 
                     if (uri != null) {
                         result.add(new FileEntry(properties.getProperty(file), uri));
+                    } else {
+                        LOG.error("Cannot find library entry: " + file);
                     }
                 } catch (URISyntaxException e) {
                     // ignore entry
@@ -597,7 +614,7 @@ public class ClientHelper {
 
             return result;
         } catch (IOException e) {
-            e.printStackTrace();
+            LOG.error("Cannot read library file: " + propertiesFile);
             return null;
         } finally {
             try {