Package org.apache.tika.fuzzing.pdf
Class PDFTransformerConfig
java.lang.Object
org.apache.tika.fuzzing.pdf.PDFTransformerConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSet<org.apache.pdfbox.cos.COSName>
Which filters are allowedList<org.apache.pdfbox.cos.COSName>
getFilters
(org.apache.pdfbox.cos.COSBase existingFilters) IfmaxFilters
> 0, this will randomly select filters given themaxFilters
andminFilters
.long
float
float
void
setAllowableFilters
(Set<org.apache.pdfbox.cos.COSName> allowableFilters) void
setMaxFilteredStreamLength
(long maxFilteredStreamLength) Maximum filtered stream length.void
setMaxFilters
(int maxFilters) void
setMinFilters
(int minFilters) Minimum number of filters to apply to streams.void
setRandomizeObjectNumbers
(float randomizeObjectNumbers) void
setRandomizeRefNumbers
(float randomizeRefNumbers) void
setStreamTransformer
(Transformer transformer) This transformer is applied to the stream _after_ each filter has been applied.void
setUnfilteredStreamTransformer
(Transformer transformer) This transformer is applied to the stream _before_ any filters are applied.
-
Constructor Details
-
PDFTransformerConfig
public PDFTransformerConfig()
-
-
Method Details
-
getRandomizeObjectNumbers
public float getRandomizeObjectNumbers() -
setRandomizeObjectNumbers
public void setRandomizeObjectNumbers(float randomizeObjectNumbers) - Parameters:
randomizeObjectNumbers
- probability that a given object number will be randomized. If < 0, this will be ignored.
-
getRandomizeRefNumbers
public float getRandomizeRefNumbers() -
setRandomizeRefNumbers
public void setRandomizeRefNumbers(float randomizeRefNumbers) - Parameters:
randomizeRefNumbers
- probability that a given reference number will be randomized. If < 0, this will be ignored.
-
getUnfilteredStreamTransformer
-
setUnfilteredStreamTransformer
This transformer is applied to the stream _before_ any filters are applied.- Parameters:
transformer
-
-
getStreamTransformer
-
setStreamTransformer
This transformer is applied to the stream _after_ each filter has been applied.- Parameters:
transformer
-
-
setMaxFilters
public void setMaxFilters(int maxFilters) - Parameters:
maxFilters
- maximum number of filters to apply
-
getAllowableFilters
Which filters are allowed- Returns:
-
setAllowableFilters
-
getFilters
public List<org.apache.pdfbox.cos.COSName> getFilters(org.apache.pdfbox.cos.COSBase existingFilters) IfmaxFilters
> 0, this will randomly select filters given themaxFilters
andminFilters
. IfmaxFilters
< 0, this will return the existing filters.- Parameters:
existingFilters
-- Returns:
-
setMinFilters
public void setMinFilters(int minFilters) Minimum number of filters to apply to streams.- Parameters:
minFilters
-
-
getMaxFilteredStreamLength
public long getMaxFilteredStreamLength() -
setMaxFilteredStreamLength
public void setMaxFilteredStreamLength(long maxFilteredStreamLength) Maximum filtered stream length. AsciiHex doubles the size of the stream with each encoding. This is used as a circuit breaker to stop adding filters if the stream goes above a given length.- Parameters:
maxFilteredStreamLength
-
-