Search in sources :

Example 26 with FilesystemAsset

use of org.apache.archiva.repository.storage.fs.FilesystemAsset in project archiva by apache.

the class ArtifactBuilderTest method getFile.

StorageAsset getFile(String path) throws IOException {
    Path filePath = Paths.get(path);
    FilesystemStorage filesystemStorage = new FilesystemStorage(filePath.getParent(), new DefaultFileLockManager());
    return new FilesystemAsset(filesystemStorage, filePath.getFileName().toString(), filePath);
}
Also used : Path(java.nio.file.Path) FilesystemStorage(org.apache.archiva.repository.storage.fs.FilesystemStorage) FilesystemAsset(org.apache.archiva.repository.storage.fs.FilesystemAsset) DefaultFileLockManager(org.apache.archiva.common.filelock.DefaultFileLockManager)

Aggregations

FilesystemAsset (org.apache.archiva.repository.storage.fs.FilesystemAsset)26 Test (org.junit.Test)20 Path (java.nio.file.Path)13 DefaultFileLockManager (org.apache.archiva.common.filelock.DefaultFileLockManager)13 FilesystemStorage (org.apache.archiva.repository.storage.fs.FilesystemStorage)13 ArtifactContentEntry (org.apache.archiva.rest.api.model.ArtifactContentEntry)6 OutputStream (java.io.OutputStream)5 IOException (java.io.IOException)3 InputStream (java.io.InputStream)3 URI (java.net.URI)3 IndexCreationFeature (org.apache.archiva.repository.features.IndexCreationFeature)3 Instant (java.time.Instant)2 Before (org.junit.Before)2 Files (java.nio.file.Files)1 Paths (java.nio.file.Paths)1 DateFormat (java.text.DateFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 TimeZone (java.util.TimeZone)1 Configuration (org.apache.archiva.configuration.model.Configuration)1