]> source.dussan.org Git - archiva.git/commitdiff
split path using Pattern.quote to be windoz friendly
authorskygo <skygo@unknown>
Tue, 11 Sep 2012 21:12:32 +0000 (21:12 +0000)
committerskygo <skygo@unknown>
Tue, 11 Sep 2012 21:12:32 +0000 (21:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1383613 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java

index 589b6b6ed7ecf4ffde95cb990494023e61f69bbc..c2a3f94b77aa51f11afdf5bc88c240c330a1dfb6 100644 (file)
@@ -54,6 +54,7 @@ import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.TimeZone;
+import java.util.regex.Pattern;
 
 /**
  *
@@ -203,9 +204,9 @@ public class Maven2RepositoryMerger
                                        METADATA_FILENAME );
 
             if ( versionMetaDataFileInSourceRepo.exists() )
-            {
+            {//Pattern quote for windows path
                 String relativePathToVersionMetadataFile =
-                    versionMetaDataFileInSourceRepo.getAbsolutePath().split( sourceRepoPath )[1];
+                     versionMetaDataFileInSourceRepo.getAbsolutePath().split( Pattern.quote( sourceRepoPath ) )[1];
                 File versionMetaDataFileInTargetRepo = new File( targetRepoPath, relativePathToVersionMetadataFile );
 
                 if ( !versionMetaDataFileInTargetRepo.exists() )
@@ -226,7 +227,7 @@ public class Maven2RepositoryMerger
             if ( projectMetadataFileInSourceRepo.exists() )
             {
                 String relativePathToProjectMetadataFile =
-                    projectMetadataFileInSourceRepo.getAbsolutePath().split( sourceRepoPath )[1];
+                    projectMetadataFileInSourceRepo.getAbsolutePath().split( Pattern.quote( sourceRepoPath ) )[1];
                 File projectMetadataFileInTargetRepo = new File( targetRepoPath, relativePathToProjectMetadataFile );
 
                 if ( !projectMetadataFileInTargetRepo.exists() )