Search in sources :

Example 1 with BasicRemoteRepository

use of org.apache.archiva.repository.base.remote.BasicRemoteRepository in project archiva by apache.

the class RepositoryProviderMock method createRemoteInstance.

@Override
public RemoteRepository createRemoteInstance(RemoteRepositoryConfiguration configuration) throws RepositoryException {
    BasicRemoteRepository remoteRepository = null;
    try {
        remoteRepository = BasicRemoteRepository.newFilesystemInstance(configuration.getId(), configuration.getName(), Paths.get("target/remotes"));
    } catch (IOException e) {
        throw new RepositoryException(e);
    }
    updateRemoteInstance(remoteRepository, configuration);
    return remoteRepository;
}
Also used : BasicRemoteRepository(org.apache.archiva.repository.base.remote.BasicRemoteRepository) RepositoryException(org.apache.archiva.repository.RepositoryException) IOException(java.io.IOException)

Example 2 with BasicRemoteRepository

use of org.apache.archiva.repository.base.remote.BasicRemoteRepository in project archiva by apache.

the class RepositoryProviderMock method createRemoteInstance.

@Override
public RemoteRepository createRemoteInstance(RemoteRepositoryConfiguration configuration) throws RepositoryException {
    try {
        BasicRemoteRepository remoteRepository = BasicRemoteRepository.newFilesystemInstance(configuration.getId(), configuration.getName(), Paths.get("target/remotes"));
        updateRemoteInstance(remoteRepository, configuration);
        return remoteRepository;
    } catch (IOException e) {
        throw new RepositoryException(e);
    }
}
Also used : BasicRemoteRepository(org.apache.archiva.repository.base.remote.BasicRemoteRepository) RepositoryException(org.apache.archiva.repository.RepositoryException) IOException(java.io.IOException)

Example 3 with BasicRemoteRepository

use of org.apache.archiva.repository.base.remote.BasicRemoteRepository in project archiva by apache.

the class RepositoryProviderMock method createRemoteInstance.

@Override
public RemoteRepository createRemoteInstance(RemoteRepositoryConfiguration configuration) throws RepositoryException {
    BasicRemoteRepository remoteRepository = null;
    try {
        remoteRepository = BasicRemoteRepository.newFilesystemInstance(configuration.getId(), configuration.getName(), Paths.get("target/remotes"));
    } catch (IOException e) {
        throw new RepositoryException(e);
    }
    updateRemoteInstance(remoteRepository, configuration);
    return remoteRepository;
}
Also used : BasicRemoteRepository(org.apache.archiva.repository.base.remote.BasicRemoteRepository) RepositoryException(org.apache.archiva.repository.RepositoryException) IOException(java.io.IOException)

Example 4 with BasicRemoteRepository

use of org.apache.archiva.repository.base.remote.BasicRemoteRepository in project archiva by apache.

the class RepositoryGroupHandlerTest method getRemote.

protected RemoteRepository getRemote(String id, String name) throws IOException {
    Path path = getRepoBaseDir().resolve("../remote");
    FileLockManager lockManager = new DefaultFileLockManager();
    FilesystemStorage storage = new FilesystemStorage(path.toAbsolutePath(), lockManager);
    return new BasicRemoteRepository(id, name, storage);
}
Also used : Path(java.nio.file.Path) FileLockManager(org.apache.archiva.common.filelock.FileLockManager) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager) BasicRemoteRepository(org.apache.archiva.repository.base.remote.BasicRemoteRepository) FilesystemStorage(org.apache.archiva.repository.storage.fs.FilesystemStorage) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager)

Example 5 with BasicRemoteRepository

use of org.apache.archiva.repository.base.remote.BasicRemoteRepository in project archiva by apache.

the class RepositoryScannerTest method createRemoteRepository.

protected EditableRemoteRepository createRemoteRepository(String id, String name, String url) throws URISyntaxException, IOException {
    BasicRemoteRepository repo = BasicRemoteRepository.newFilesystemInstance(id, name, Paths.get("remotes"));
    repo.setLocation(new URI(url));
    return repo;
}
Also used : BasicRemoteRepository(org.apache.archiva.repository.base.remote.BasicRemoteRepository) URI(java.net.URI)

Aggregations

BasicRemoteRepository (org.apache.archiva.repository.base.remote.BasicRemoteRepository)8 IOException (java.io.IOException)4 RepositoryException (org.apache.archiva.repository.RepositoryException)4 URI (java.net.URI)2 Path (java.nio.file.Path)1 DefaultFileLockManager (org.apache.archiva.common.filelock.DefaultFileLockManager)1 FileLockManager (org.apache.archiva.common.filelock.FileLockManager)1 RemoteRepository (org.apache.archiva.repository.RemoteRepository)1 FilesystemStorage (org.apache.archiva.repository.storage.fs.FilesystemStorage)1 Test (org.junit.jupiter.api.Test)1