Skip to content

Commit bb22f81

Browse files
committed
Allow transformers to mark files for removal
To do this, they should return null rather than an entry. This fixes GH-8.
1 parent e55fc54 commit bb22f81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/cadixdev/atlas/jar/JarFile.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ public void transform(final Path export, final JarEntryTransformer... transforme
167167
// Transform the entry
168168
for (final JarEntryTransformer transformer : transformers) {
169169
entry = entry.accept(transformer);
170+
171+
// If a transformer wants to remove an entry, it should return null.
172+
// TODO: document this in Bombe
173+
if (entry == null) return null;
170174
}
171175

172176
// Write to jar

0 commit comments

Comments
 (0)