take care of windows file format and replace for url fetching

see mail thread: http://markmail.org/message/izqupvyvwojdamk3

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1307348 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-03-30 10:24:07 +00:00
parent f6b701ede4
commit f994014554
1 changed files with 8 additions and 0 deletions

View File

@ -51,7 +51,9 @@ import org.apache.archiva.scheduler.ArchivaTaskScheduler;
import org.apache.archiva.scheduler.repository.RepositoryTask; import org.apache.archiva.scheduler.repository.RepositoryTask;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.SystemUtils;
import org.apache.maven.wagon.ConnectionException; import org.apache.maven.wagon.ConnectionException;
import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.ResourceDoesNotExistException;
import org.apache.maven.wagon.Wagon; import org.apache.maven.wagon.Wagon;
@ -286,6 +288,12 @@ public class DefaultRepositoryProxyConnectors
String targetPath = targetRepository.toPath( artifact ); String targetPath = targetRepository.toPath( artifact );
if ( SystemUtils.IS_OS_WINDOWS )
{
// toPath use system PATH_SEPARATOR so on windows url are \ which doesn't work very well :-)
targetPath = FilenameUtils.separatorsToUnix( targetPath );
}
try try
{ {
File downloadedFile = File downloadedFile =