tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r663029 - /incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
Date Wed, 04 Jun 2008 08:22:23 GMT
Author: jsdelfino
Date: Wed Jun  4 01:22:22 2008
New Revision: 663029

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

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

Modified: incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java?rev=663029&r1=663028&r2=663029&view=diff
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
(original)
+++ incubator/tuscany/sandbox/sebastien/java/sca-test2/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
Wed Jun  4 01:22:22 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));
                 }
             }



Mime
View raw message