Search in sources :

Example 6 with FileLockManager

use of org.apache.archiva.common.filelock.FileLockManager in project archiva by apache.

the class RepositoryGroupHandlerTest method getManaged.

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

Example 7 with FileLockManager

use of org.apache.archiva.common.filelock.FileLockManager in project archiva by apache.

the class ManagedRepositoryHandlerTest method createRepository.

protected EditableManagedRepository createRepository(String id, String name, Path location) throws IOException {
    FileLockManager lockManager = new DefaultFileLockManager();
    FilesystemStorage storage = new FilesystemStorage(location.toAbsolutePath(), lockManager);
    BasicManagedRepository repo = new BasicManagedRepository(id, name, storage);
    repo.setLocation(location.toAbsolutePath().toUri());
    return repo;
}
Also used : FileLockManager(org.apache.archiva.common.filelock.FileLockManager) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager) FilesystemStorage(org.apache.archiva.repository.storage.fs.FilesystemStorage) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager)

Example 8 with FileLockManager

use of org.apache.archiva.common.filelock.FileLockManager in project archiva by apache.

the class RepositoryScannerTest method createRepository.

protected EditableManagedRepository createRepository(String id, String name, Path location) throws IOException {
    FileLockManager lockManager = new DefaultFileLockManager();
    FilesystemStorage storage = new FilesystemStorage(location.toAbsolutePath(), lockManager);
    BasicManagedRepository repo = new BasicManagedRepository(id, name, storage);
    repo.setLocation(location.toAbsolutePath().toUri());
    repo.setContent(new ManagedRepositoryContentMock(repo));
    return repo;
}
Also used : FileLockManager(org.apache.archiva.common.filelock.FileLockManager) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager) BasicManagedRepository(org.apache.archiva.repository.base.managed.BasicManagedRepository) FilesystemStorage(org.apache.archiva.repository.storage.fs.FilesystemStorage) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager) ManagedRepositoryContentMock(org.apache.archiva.repository.scanner.mock.ManagedRepositoryContentMock)

Example 9 with FileLockManager

use of org.apache.archiva.common.filelock.FileLockManager in project archiva by apache.

the class RemoteRepositoryHandlerTest method createRepository.

protected EditableRemoteRepository createRepository(String id, String name, Path location) throws IOException {
    FileLockManager lockManager = new DefaultFileLockManager();
    FilesystemStorage storage = new FilesystemStorage(location.toAbsolutePath(), lockManager);
    BasicRemoteRepository repo = new BasicRemoteRepository(id, name, storage);
    repo.setLocation(location.toAbsolutePath().toUri());
    return repo;
}
Also used : FileLockManager(org.apache.archiva.common.filelock.FileLockManager) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager) FilesystemStorage(org.apache.archiva.repository.storage.fs.FilesystemStorage) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager)

Example 10 with FileLockManager

use of org.apache.archiva.common.filelock.FileLockManager in project archiva by apache.

the class MavenManagedRepository method newLocalInstance.

public static MavenManagedRepository newLocalInstance(String id, String name, Path basePath) throws IOException {
    FileLockManager lockManager = new DefaultFileLockManager();
    FilesystemStorage storage = new FilesystemStorage(basePath.resolve(id), lockManager);
    return new MavenManagedRepository(id, name, storage);
}
Also used : FileLockManager(org.apache.archiva.common.filelock.FileLockManager) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager) FilesystemStorage(org.apache.archiva.repository.storage.fs.FilesystemStorage) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager)

Aggregations

FileLockManager (org.apache.archiva.common.filelock.FileLockManager)15 DefaultFileLockManager (org.apache.archiva.common.filelock.DefaultFileLockManager)14 FilesystemStorage (org.apache.archiva.repository.storage.fs.FilesystemStorage)14 Path (java.nio.file.Path)2 BasicManagedRepository (org.apache.archiva.repository.base.managed.BasicManagedRepository)2 IOException (java.io.IOException)1 FileLockException (org.apache.archiva.common.filelock.FileLockException)1 Lock (org.apache.archiva.common.filelock.Lock)1 BasicRemoteRepository (org.apache.archiva.repository.base.remote.BasicRemoteRepository)1 ManagedRepositoryContentMock (org.apache.archiva.repository.mock.ManagedRepositoryContentMock)1 RemoteRepositoryContentMock (org.apache.archiva.repository.mock.RemoteRepositoryContentMock)1 ManagedRepositoryContentMock (org.apache.archiva.repository.scanner.mock.ManagedRepositoryContentMock)1 RepositoryStorage (org.apache.archiva.repository.storage.RepositoryStorage)1