tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r662939 - /incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
Date Wed, 04 Jun 2008 01:30:27 GMT
Author: jsdelfino
Date: Tue Jun  3 18:30:27 2008
New Revision: 662939

URL: http://svn.apache.org/viewvc?rev=662939&view=rev
Log:
Fixed check to exclude domain directory from list of available contributions

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=662939&r1=662938&r2=662939&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
Tue Jun  3 18:30:27 2008
@@ -297,8 +297,12 @@
             
         } if (queryString.startsWith("suggestions=true")) {
             
-            // Returns a list of contribution suggestions, by scanning the parent of the
workspace
-            // directory for potential contribution directories, for example project directories
+            // Returns a list of contribution suggestions, scan the parent of the workspace
+            // directory for potential contribution directories
+            
+            // For now, recognize project directories that contain .project files
+            // Directories containing .classpath files are likely to be Java projects, we
parse
+            // the .classpath file to determine the Java project output location 
             Workspace suggestionWorkspace = workspaceFactory.createWorkspace();
             List<Entry> entries = new ArrayList<Entry>();
             String rootDirectory = domainManagerConfiguration.getRootDirectory();
@@ -313,7 +317,7 @@
                 String uri = project.getName();
                 File location = project;
                 
-                // If this is a Java project, find it's output location
+                // If this is a Java project, parse its .classpath file to determine it's
output location
                 File dotClasspath = new File(project, ".classpath");
                 if (dotClasspath.exists()) {
                     try {
@@ -339,8 +343,11 @@
                     
                 }
                 
-                // Create a contribution entry
-                if (!location.getPath().startsWith(rootLocation.getPath())) {
+                // 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 (!locationPath.startsWith(rootLocationPath + "/") && !locationPath.equals(rootLocationPath))
{
                     Contribution contribution = contributionFactory.createContribution();
                     contribution.setURI(uri);
                     contribution.setLocation(location.getPath());



Mime
View raw message