Skip to content

Commit

Permalink
Earlier detection of mkdirs failure (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo authored and michael-o committed Jul 28, 2024
1 parent 73b57d3 commit 54faaa8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ public void storeInLocalRepository(ArtifactRepository localRepository, ArtifactR
File destination = new File(
localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata(this, remoteRepository));

destination.getParentFile().mkdirs();
if (!destination.getParentFile().mkdirs()) {
throw new RepositoryMetadataStoreException(
"Could not create artifact directory " + destination + " in local repository");
}

try (Writer writer = new XmlStreamWriter(destination)) {
new SiteXpp3Writer().write(writer, siteModel);
Expand Down

0 comments on commit 54faaa8

Please sign in to comment.