Skip to content

Commit 6925115

Browse files
committed
Add new method (postCreateArchive) to AbstractArchiver
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
1 parent 6654fae commit 6925115

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111

1212
<artifactId>plexus-archiver</artifactId>
13-
<version>3.5.1-SNAPSHOT</version>
13+
<version>3.6.0-SNAPSHOT</version>
1414
<name>Plexus Archiver Component</name>
1515

1616
<scm>

src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java

+17
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,8 @@ public final void createArchive()
10071007
{
10081008
cleanUp();
10091009
}
1010+
1011+
postCreateArchive();
10101012
}
10111013

10121014
protected boolean hasVirtualFiles()
@@ -1036,6 +1038,21 @@ protected void validate()
10361038
{
10371039
}
10381040

1041+
/**
1042+
* This method is called after the archive creation
1043+
* completes successfully (no exceptions are thrown).
1044+
*
1045+
* Subclasses may override this method in order to
1046+
* augment or validate the archive after it is
1047+
* created.
1048+
*
1049+
* @since 3.6
1050+
*/
1051+
protected void postCreateArchive()
1052+
throws ArchiverException, IOException
1053+
{
1054+
}
1055+
10391056
protected abstract String getArchiveType();
10401057

10411058
private void addCloseable( Object maybeCloseable )

0 commit comments

Comments
 (0)