diff options
author | Martin Stockhammer <martin_s@apache.org> | 2019-05-25 10:30:34 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2019-05-25 10:30:34 +0200 |
commit | aabd20f66839032f335f19b29dec0098fbffb178 (patch) | |
tree | 7faa05a5bc613ea132528c5d0045e68ea8701607 /archiva-modules | |
parent | 53c58d457dd881ca517abec1a1d86c168d26de38 (diff) | |
download | archiva-aabd20f66839032f335f19b29dec0098fbffb178.tar.gz archiva-aabd20f66839032f335f19b29dec0098fbffb178.zip |
Fixing exception handling for filesystem storage initialization
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java index 92c9b6039..c34c01d0a 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java @@ -83,7 +83,12 @@ public class ManagedDefaultRepositoryContent super(Collections.singletonList( new DefaultArtifactMappingProvider() )); setFileTypes( fileTypes ); setRepository( repository ); - storage = new FilesystemStorage(getRepoDir(), lockManager); + try { + storage = new FilesystemStorage(getRepoDir(), lockManager); + } catch (IOException e) { + log.error("Could not initialize the filesystem storage to repository: {}", getRepoDir()); + throw new RuntimeException("Fatal error. Could not initialize the filesystem storage for "+getRepoDir()); + } } public ManagedDefaultRepositoryContent( ManagedRepository repository, List<? extends ArtifactMappingProvider> artifactMappingProviders, FileTypes fileTypes, FileLockManager lockManager ) @@ -91,7 +96,12 @@ public class ManagedDefaultRepositoryContent super(artifactMappingProviders==null ? Collections.singletonList( new DefaultArtifactMappingProvider() ) : artifactMappingProviders); setFileTypes( fileTypes ); setRepository( repository ); - storage = new FilesystemStorage(getRepoDir(), lockManager); + try { + storage = new FilesystemStorage(getRepoDir(), lockManager); + } catch (IOException e) { + log.error("Could not initialize the filesystem storage to repository: {}", getRepoDir()); + throw new RuntimeException("Fatal error. Could not initialize the filesystem storage for "+getRepoDir()); + } } private Path getRepoDir() { |