@@ -526,7 +526,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager { | |||
private StorageAsset getIndexPath( Repository repo) throws IOException { | |||
IndexCreationFeature icf = repo.getFeature(IndexCreationFeature.class).get(); | |||
Path repoDir = repo.getLocalPath(); | |||
Path repoDir = repo.getAsset("").getFilePath(); | |||
URI indexDir = icf.getIndexPath(); | |||
String indexPath = indexDir.getPath(); | |||
Path indexDirectory = null; | |||
@@ -565,7 +565,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager { | |||
// create remote repository path | |||
Path repoDir = remoteRepository.getLocalPath(); | |||
Path repoDir = remoteRepository.getAsset("").getFilePath(); | |||
if ( !Files.exists( repoDir ) ) | |||
{ | |||
Files.createDirectories( repoDir ); | |||
@@ -615,7 +615,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager { | |||
IndexingContext context; | |||
// take care first about repository location as can be relative | |||
Path repositoryDirectory = repository.getLocalPath(); | |||
Path repositoryDirectory = repository.getAsset("").getFilePath(); | |||
if ( !Files.exists( repositoryDirectory ) ) | |||
{ |
@@ -626,12 +626,12 @@ public class MavenIndexManager implements ArchivaIndexManager { | |||
private StorageAsset getIndexPath( Repository repo) throws IOException { | |||
IndexCreationFeature icf = repo.getFeature(IndexCreationFeature.class).get(); | |||
return getIndexPath( icf.getIndexPath(), repo.getLocalPath(), DEFAULT_INDEX_PATH); | |||
return getIndexPath( icf.getIndexPath(), repo.getAsset( "" ).getFilePath(), DEFAULT_INDEX_PATH); | |||
} | |||
private StorageAsset getPackedIndexPath(Repository repo) throws IOException { | |||
IndexCreationFeature icf = repo.getFeature(IndexCreationFeature.class).get(); | |||
return getIndexPath(icf.getPackedIndexPath(), repo.getLocalPath(), DEFAULT_PACKED_INDEX_PATH); | |||
return getIndexPath(icf.getPackedIndexPath(), repo.getAsset( "" ).getFilePath(), DEFAULT_PACKED_INDEX_PATH); | |||
} | |||
private IndexingContext createRemoteContext(RemoteRepository remoteRepository ) throws IOException | |||
@@ -642,7 +642,7 @@ public class MavenIndexManager implements ArchivaIndexManager { | |||
// create remote repository path | |||
Path repoDir = remoteRepository.getLocalPath(); | |||
Path repoDir = remoteRepository.getAsset( "" ).getFilePath(); | |||
if ( !Files.exists( repoDir ) ) | |||
{ | |||
Files.createDirectories( repoDir ); | |||
@@ -701,7 +701,7 @@ public class MavenIndexManager implements ArchivaIndexManager { | |||
IndexingContext context; | |||
// take care first about repository location as can be relative | |||
Path repositoryDirectory = repository.getLocalPath(); | |||
Path repositoryDirectory = repository.getAsset( "" ).getFilePath(); | |||
if ( !Files.exists( repositoryDirectory ) ) | |||
{ |
@@ -93,7 +93,7 @@ public class MavenIndexManagerTest { | |||
@Test | |||
public void pack() throws Exception { | |||
createTestContext(); | |||
Path destDir = repository.getLocalPath().resolve("org/apache/archiva/archiva-webapp/1.0"); | |||
Path destDir = repository.getAsset( "" ).getFilePath().resolve("org/apache/archiva/archiva-webapp/1.0"); | |||
Path srcDir = Paths.get("src/test/maven-search-test-repo/org/apache/archiva/archiva-webapp/1.0"); | |||
org.apache.commons.io.FileUtils.copyDirectory(srcDir.toFile(),destDir.toFile()); | |||
mavenIndexManager.scan(ctx); | |||
@@ -110,7 +110,7 @@ public class MavenIndexManagerTest { | |||
@Test | |||
public void scan() throws Exception { | |||
createTestContext(); | |||
Path destDir = repository.getLocalPath().resolve("org/apache/archiva/archiva-webapp/1.0"); | |||
Path destDir = repository.getAsset("").getFilePath().resolve("org/apache/archiva/archiva-webapp/1.0"); | |||
Path srcDir = Paths.get("src/test/maven-search-test-repo/org/apache/archiva/archiva-webapp/1.0"); | |||
org.apache.commons.io.FileUtils.copyDirectory(srcDir.toFile(),destDir.toFile()); | |||
mavenIndexManager.scan(ctx); | |||
@@ -138,7 +138,7 @@ public class MavenIndexManagerTest { | |||
public void addArtifactsToIndex() throws Exception { | |||
ArchivaIndexingContext ctx = createTestContext(); | |||
Path destDir = repository.getLocalPath().resolve("org/apache/archiva/archiva-search/1.0"); | |||
Path destDir = repository.getAsset( "" ).getFilePath().resolve("org/apache/archiva/archiva-search/1.0"); | |||
Path srcDir = Paths.get("src/test/maven-search-test-repo/org/apache/archiva/archiva-search/1.0"); | |||
org.apache.commons.io.FileUtils.copyDirectory(srcDir.toFile(), destDir.toFile()); | |||
List<URI> uriList = new ArrayList<>(); | |||
@@ -156,7 +156,7 @@ public class MavenIndexManagerTest { | |||
@Test | |||
public void removeArtifactsFromIndex() throws Exception { | |||
ArchivaIndexingContext ctx = createTestContext(); | |||
Path destDir = repository.getLocalPath().resolve("org/apache/archiva/archiva-search/1.0"); | |||
Path destDir = repository.getAsset( "" ).getFilePath().resolve("org/apache/archiva/archiva-search/1.0"); | |||
Path srcDir = Paths.get("src/test/maven-search-test-repo/org/apache/archiva/archiva-search/1.0"); | |||
org.apache.commons.io.FileUtils.copyDirectory(srcDir.toFile(), destDir.toFile()); | |||
List<URI> uriList = new ArrayList<>(); |
@@ -233,7 +233,7 @@ public class Maven3DependencyTreeBuilder | |||
for ( String repoId : repositoryIds ) | |||
{ | |||
ManagedRepository managedRepo = repositoryRegistry.getManagedRepository(repoId); | |||
Path repoDir = managedRepo.getLocalPath(); | |||
Path repoDir = managedRepo.getAsset("").getFilePath(); | |||
Path file = pathTranslator.toFile( repoDir, projectArtifact.getGroupId(), projectArtifact.getArtifactId(), | |||
projectArtifact.getBaseVersion(), |
@@ -123,7 +123,7 @@ public class RepositoryModelResolver | |||
this.targetRepository = targetRepository; | |||
this.session = MavenSystemManager.newRepositorySystemSession( managedRepository.getLocalPath().toString() ); | |||
this.session = MavenSystemManager.newRepositorySystemSession( managedRepository.getAsset("").getFilePath().toString() ); | |||
this.versionRangeResolver = mavenSystemManager.getLocator().getService(VersionRangeResolver.class); | |||
@@ -300,7 +300,7 @@ public class RepositoryModelResolver | |||
Path tmpSha1 = null; | |||
Path tmpResource = null; | |||
String artifactPath = pathTranslator.toPath( groupId, artifactId, version, filename ); | |||
Path resource = targetRepository.getLocalPath().resolve( artifactPath ); | |||
Path resource = targetRepository.getAsset("").getFilePath().resolve( artifactPath ); | |||
Path workingDirectory = createWorkingDirectory( targetRepository.getLocation().toString() ); | |||
try |
@@ -168,14 +168,14 @@ public class MavenRepositoryProvider implements RepositoryProvider { | |||
throw new RepositoryException("The location entry is not a valid uri: " + cfg.getLocation()); | |||
} | |||
setBaseConfig(repo, cfg); | |||
Path repoDir = repo.getLocalPath(); | |||
Path repoDir = repo.getAsset("").getFilePath(); | |||
if (!Files.exists(repoDir)) { | |||
log.debug("Creating repo directory {}", repoDir); | |||
try { | |||
Files.createDirectories(repoDir); | |||
} catch (IOException e) { | |||
log.error("Could not create directory {} for repository {}", repo.getLocalPath(), repo.getId(), e); | |||
throw new RepositoryException("Could not create directory for repository " + repo.getLocalPath()); | |||
log.error("Could not create directory {} for repository {}", repoDir, repo.getId(), e); | |||
throw new RepositoryException("Could not create directory for repository " + repoDir); | |||
} | |||
} | |||
repo.setSchedulingDefinition(cfg.getRefreshCronExpression()); |
@@ -529,7 +529,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager { | |||
private StorageAsset getIndexPath( Repository repo) throws IOException { | |||
IndexCreationFeature icf = repo.getFeature(IndexCreationFeature.class).get(); | |||
Path repoDir = repo.getLocalPath(); | |||
Path repoDir = repo.getAsset( "" ).getFilePath(); | |||
URI indexDir = icf.getIndexPath(); | |||
String indexPath = indexDir.getPath(); | |||
Path indexDirectory = null; | |||
@@ -568,7 +568,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager { | |||
// create remote repository path | |||
Path repoDir = remoteRepository.getLocalPath(); | |||
Path repoDir = remoteRepository.getAsset("").getFilePath(); | |||
if ( !Files.exists( repoDir ) ) | |||
{ | |||
Files.createDirectories( repoDir ); | |||
@@ -618,7 +618,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager { | |||
IndexingContext context; | |||
// take care first about repository location as can be relative | |||
Path repositoryDirectory = repository.getLocalPath(); | |||
Path repositoryDirectory = repository.getAsset("").getFilePath(); | |||
if ( !Files.exists( repositoryDirectory ) ) | |||
{ |
@@ -132,7 +132,7 @@ public class ArchivaIndexingTaskExecutorTest | |||
public void testAddArtifactToIndex() | |||
throws Exception | |||
{ | |||
Path basePath = repo.getLocalPath(); | |||
Path basePath = repo.getAsset("").getFilePath(); | |||
Path artifactFile = basePath.resolve( | |||
"org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); | |||
@@ -174,7 +174,7 @@ public class ArchivaIndexingTaskExecutorTest | |||
public void testUpdateArtifactInIndex() | |||
throws Exception | |||
{ | |||
Path basePath = repo.getLocalPath(); | |||
Path basePath = repo.getAsset("").getFilePath(); | |||
Path artifactFile = basePath.resolve( | |||
"org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); | |||
@@ -211,7 +211,7 @@ public class ArchivaIndexingTaskExecutorTest | |||
public void testRemoveArtifactFromIndex() | |||
throws Exception | |||
{ | |||
Path basePath = repo.getLocalPath(); | |||
Path basePath = repo.getAsset("").getFilePath(); | |||
Path artifactFile = basePath.resolve( | |||
"org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); | |||
@@ -274,7 +274,7 @@ public class ArchivaIndexingTaskExecutorTest | |||
throws Exception | |||
{ | |||
Path basePath = repo.getLocalPath(); | |||
Path basePath = repo.getAsset("").getFilePath(); | |||
IndexCreationFeature icf = repo.getFeature( IndexCreationFeature.class ).get(); | |||
StorageAsset packedIndexDirectory = icf.getLocalPackedIndexPath(); | |||
StorageAsset indexerDirectory = icf.getLocalIndexPath(); |
@@ -513,7 +513,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager { | |||
private StorageAsset getIndexPath( Repository repo) throws IOException { | |||
IndexCreationFeature icf = repo.getFeature(IndexCreationFeature.class).get(); | |||
Path repoDir = repo.getLocalPath(); | |||
Path repoDir = repo.getAsset("").getFilePath(); | |||
URI indexDir = icf.getIndexPath(); | |||
String indexPath = indexDir.getPath(); | |||
Path indexDirectory = null; | |||
@@ -552,7 +552,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager { | |||
// create remote repository path | |||
Path repoDir = remoteRepository.getLocalPath(); | |||
Path repoDir = remoteRepository.getAsset("").getFilePath(); | |||
if ( !Files.exists( repoDir ) ) | |||
{ | |||
Files.createDirectories( repoDir ); | |||
@@ -602,7 +602,7 @@ public class ArchivaIndexManagerMock implements ArchivaIndexManager { | |||
IndexingContext context; | |||
// take care first about repository location as can be relative | |||
Path repositoryDirectory = repository.getLocalPath(); | |||
Path repositoryDirectory = repository.getAsset("").getFilePath(); | |||
if ( !Files.exists( repositoryDirectory ) ) | |||
{ |