From 0495fe9bc690864d03f8e704d2882dba8b4a4c76 Mon Sep 17 00:00:00 2001 From: skygo Date: Tue, 11 Sep 2012 21:12:32 +0000 Subject: [PATCH] split path using Pattern.quote to be windoz friendly git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1383613 13f79535-47bb-0310-9956-ffa450edef68 --- .../stagerepository/merge/Maven2RepositoryMerger.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java b/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java index 589b6b6ed..c2a3f94b7 100644 --- a/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java +++ b/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java @@ -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() ) -- 2.39.5