svn commit: rev 21205 - avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks

[email protected]
Newsgroups gmane.comp.jakarta.avalon.cvs
Message-ID <[email protected]>
Author: mcconnell
Date: Mon Jun 14 06:41:43 2004
New Revision: 21205

Modified:
   avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/FilterTask.java
Log:
fix native path generation for windows

Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/FilterTask.java
==============================================================================
--- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/FilterTask.java	(original)
+++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/FilterTask.java	Mon Jun 14 06:41:43 2004
@@ -150,22 +150,38 @@
         {
             if( i>0 )
             {
-                buffer.append( File.pathSeparator );
+                buffer.append( ";" );
             }
 
             ResourceRef ref = refs[i];
             Resource resource = getHome().getResource( ref );
-            buffer.append( symbol );
-            if( windows )
-            {
-                buffer.append( "\\" );
-                buffer.append( resource.getInfo().getPath().replace( '/', '\\' ) );
-            }
-            else
-            {
-                buffer.append( "/" );
-                String path = resource.getInfo().getPath();
-            }
+            String path = getNativePath( windows, resource );
+            buffer.append( path );
+        }
+
+        if( refs.length > 0 )
+        {
+            buffer.append( ";" );
+        }
+
+        buffer.append( getNativePath( windows, def ) ); 
+        return buffer.toString();
+    }
+
+    private String getNativePath( boolean windows, Resource resource )
+    {
+        String symbol = getPlatformCacheSymbol( windows );
+        StringBuffer buffer = new StringBuffer( symbol );
+        String path = resource.getInfo().getPath();
+        if( windows )
+        {
+            buffer.append( "\\" );
+            buffer.append( path.replace( '/', '\\' ) );
+        }
+        else
+        {
+            buffer.append( "/" );
+            buffer.append( path );
         }
         return buffer.toString();
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.