Package org.apache.tika.fuzzing.pdf
Class PDFTransformerConfig
- java.lang.Object
-
- org.apache.tika.fuzzing.pdf.PDFTransformerConfig
-
public class PDFTransformerConfig extends Object
-
-
Constructor Summary
Constructors Constructor Description PDFTransformerConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<org.apache.pdfbox.cos.COSName>
getAllowableFilters()
Which filters are allowedList<org.apache.pdfbox.cos.COSName>
getFilters(org.apache.pdfbox.cos.COSBase existingFilters)
long
getMaxFilteredStreamLength()
float
getRandomizeObjectNumbers()
float
getRandomizeRefNumbers()
Transformer
getStreamTransformer()
Transformer
getUnfilteredStreamTransformer()
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.
-
-
-
Method Detail
-
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
public Transformer getUnfilteredStreamTransformer()
-
setUnfilteredStreamTransformer
public void setUnfilteredStreamTransformer(Transformer transformer)
This transformer is applied to the stream _before_ any filters are applied.- Parameters:
transformer
-
-
getStreamTransformer
public Transformer getStreamTransformer()
-
setStreamTransformer
public void setStreamTransformer(Transformer transformer)
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
public Set<org.apache.pdfbox.cos.COSName> getAllowableFilters()
Which filters are allowed- Returns:
-
setAllowableFilters
public void setAllowableFilters(Set<org.apache.pdfbox.cos.COSName> allowableFilters)
-
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
-
-
-