You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2008/06/07 17:30:48 UTC

svn commit: r664352 - /incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java

Author: jsdelfino
Date: Sat Jun  7 08:30:48 2008
New Revision: 664352

URL: http://svn.apache.org/viewvc?rev=664352&view=rev
Log:
Convert Windows specific paths (containing backslashes and spaces for example) to correct URIs.


Modified:
    incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java

Modified: incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java?rev=664352&r1=664351&r2=664352&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java (original)
+++ incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java Sat Jun  7 08:30:48 2008
@@ -346,11 +346,17 @@
                 // Create a contribution entry, skip the domain root directory and childrens of the
                 // domain root directory
                 String rootLocationPath = rootLocation.getPath();
-                String locationPath = location.getPath(); 
+                if (rootLocationPath.indexOf('\\') != -1 || rootLocationPath.indexOf(' ') != -1) {
+                    rootLocationPath = new File(rootLocationPath.replace('\\', '/')).toURI().toString();
+                }
+                String locationPath = location.getPath();
+                if (locationPath.indexOf('\\') != -1 || locationPath.indexOf(' ') != -1) {
+                    locationPath = new File(locationPath.replace('\\', '/')).toURI().toString();
+                }
                 if (!locationPath.startsWith(rootLocationPath + "/") && !locationPath.equals(rootLocationPath)) {
                     Contribution contribution = contributionFactory.createContribution();
                     contribution.setURI(uri);
-                    contribution.setLocation(location.getPath());
+                    contribution.setLocation(locationPath);
                     entries.add(entry(suggestionWorkspace, contribution));
                 }
             }