Package org.jacoco.core.internal.instr
Class SignatureRemover
- java.lang.Object
-
- org.jacoco.core.internal.instr.SignatureRemover
-
public class SignatureRemover extends java.lang.ObjectSupport class to filter entries from JARs related to signatures.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanactiveprivate static java.lang.StringDIGEST_SUFFIXprivate static java.lang.StringMANIFEST_MFprivate static java.util.regex.PatternSIGNATURE_FILES
-
Constructor Summary
Constructors Constructor Description SignatureRemover()Creates a new remover which is active.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanfilterEntry(java.lang.String name, java.io.InputStream in, java.io.OutputStream out)Filters the content of the entry with the provided name if necessary.private voidfilterManifestEntry(java.util.Collection<java.util.jar.Attributes> entry)private voidfilterManifestEntryAttributes(java.util.jar.Attributes attrs)booleanremoveEntry(java.lang.String name)Checks whether a entry with the provided name should be ignored at all.voidsetActive(boolean active)Defines whether this remover should be active.
-
-
-
Field Detail
-
SIGNATURE_FILES
private static final java.util.regex.Pattern SIGNATURE_FILES
-
MANIFEST_MF
private static final java.lang.String MANIFEST_MF
- See Also:
- Constant Field Values
-
DIGEST_SUFFIX
private static final java.lang.String DIGEST_SUFFIX
- See Also:
- Constant Field Values
-
active
private boolean active
-
-
Method Detail
-
setActive
public void setActive(boolean active)
Defines whether this remover should be active. If it is not active it will not remove any entries.- Parameters:
active-trueif it should remove signature related entries.
-
removeEntry
public boolean removeEntry(java.lang.String name)
Checks whether a entry with the provided name should be ignored at all.- Parameters:
name- path name of the entry in question- Returns:
- true is the entry should be ignored
-
filterEntry
public boolean filterEntry(java.lang.String name, java.io.InputStream in, java.io.OutputStream out) throws java.io.IOExceptionFilters the content of the entry with the provided name if necessary.- Parameters:
name- path name of the entry in questionin- source for the element to filterout- output for the filtered contents- Returns:
trueif the content was filtered- Throws:
java.io.IOException- if the content can't be read or written
-
filterManifestEntry
private void filterManifestEntry(java.util.Collection<java.util.jar.Attributes> entry)
-
filterManifestEntryAttributes
private void filterManifestEntryAttributes(java.util.jar.Attributes attrs)
-
-