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 committed Jul 28, 2024
1 parent bed828c commit e2791dd
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 e2791dd

Please sign in to comment.