Skip to content

Commit

Permalink
Add new method (postCreateArchive) to AbstractArchiver
Browse files Browse the repository at this point in the history
The purpose of the method is to allow subclasses
to augment the archive after it is created.
This is going to be used to update Jar archives
to modular Jar archives.

Closes #83
  • Loading branch information
plamentotev committed Apr 14, 2018
1 parent 6654fae commit 6925115
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>plexus-archiver</artifactId>
<version>3.5.1-SNAPSHOT</version>
<version>3.6.0-SNAPSHOT</version>
<name>Plexus Archiver Component</name>

<scm>
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,8 @@ public final void createArchive()
{
cleanUp();
}

postCreateArchive();
}

protected boolean hasVirtualFiles()
Expand Down Expand Up @@ -1036,6 +1038,21 @@ protected void validate()
{
}

/**
* This method is called after the archive creation
* completes successfully (no exceptions are thrown).
*
* Subclasses may override this method in order to
* augment or validate the archive after it is
* created.
*
* @since 3.6
*/
protected void postCreateArchive()
throws ArchiverException, IOException
{
}

protected abstract String getArchiveType();

private void addCloseable( Object maybeCloseable )
Expand Down

0 comments on commit 6925115

Please sign in to comment.