tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r664352 - /incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
Date Sat, 07 Jun 2008 15:30:48 GMT
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));
                 }
             }



Mime
View raw message