Class ValidatingObjectInputStream.Builder
java.lang.Object
org.apache.commons.io.build.AbstractSupplier<ValidatingObjectInputStream,ValidatingObjectInputStream.Builder>
 
org.apache.commons.io.build.AbstractOriginSupplier<ValidatingObjectInputStream,ValidatingObjectInputStream.Builder>
 
org.apache.commons.io.build.AbstractStreamBuilder<ValidatingObjectInputStream,ValidatingObjectInputStream.Builder>
 
org.apache.commons.io.serialization.ValidatingObjectInputStream.Builder
- All Implemented Interfaces:
- IOSupplier<ValidatingObjectInputStream>
- Enclosing class:
- ValidatingObjectInputStream
public static class ValidatingObjectInputStream.Builder
extends AbstractStreamBuilder<ValidatingObjectInputStream,ValidatingObjectInputStream.Builder> 
Builds a new 
ValidatingObjectInputStream.
 Using NIO
 ValidatingObjectInputStream s = ValidatingObjectInputStream.builder()
   .setPath(Paths.get("MyFile.ser"))
   .get();
 Using IO
 ValidatingObjectInputStream s = ValidatingObjectInputStream.builder()
   .setFile(new File("MyFile.ser"))
   .get();
 - Since:
- 2.18.0
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAccepts the specified classes for deserialization, unless they are otherwise rejected.Accepts the wildcard specified classes for deserialization, unless they are otherwise rejected.Accepts class names that match the supplied pattern for deserialization, unless they are otherwise rejected.accept(ClassNameMatcher matcher) Accepts class names where the supplied ClassNameMatcher matches for deserialization, unless they are otherwise rejected.get()Builds a newValidatingObjectInputStream.Gets the predicate.Rejects the specified classes for deserialization, even if they are otherwise accepted.Rejects the wildcard specified classes for deserialization, even if they are otherwise accepted.Rejects class names that match the supplied pattern for deserialization, even if they are otherwise accepted.reject(ClassNameMatcher matcher) Rejects class names where the supplied ClassNameMatcher matches for deserialization, even if they are otherwise accepted.setPredicate(ObjectStreamClassPredicate predicate) Sets the predicate, null resets to an empty new ObjectStreamClassPredicate.Methods inherited from class org.apache.commons.io.build.AbstractStreamBuildergetBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, setCharset, setCharset, setCharsetDefault, setOpenOptionsMethods inherited from class org.apache.commons.io.build.AbstractOriginSuppliercheckOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newCharSequenceOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newRandomAccessFileOrigin, newRandomAccessFileOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setCharSequence, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriterMethods inherited from class org.apache.commons.io.build.AbstractSupplierasThisMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.io.function.IOSupplierasSupplier, getUnchecked
- 
Constructor Details- 
BuilderDeprecated.Constructs a new builder ofValidatingObjectInputStream.
 
- 
- 
Method Details- 
acceptAccepts the specified classes for deserialization, unless they are otherwise rejected.- Parameters:
- classes- Classes to accept
- Returns:
- this object
- Since:
- 2.18.0
 
- 
acceptAccepts class names where the supplied ClassNameMatcher matches for deserialization, unless they are otherwise rejected.- Parameters:
- matcher- a class name matcher to accept objects.
- Returns:
- this instance.
- Since:
- 2.18.0
 
- 
acceptAccepts class names that match the supplied pattern for deserialization, unless they are otherwise rejected.- Parameters:
- pattern- a Pattern for compiled regular expression.
- Returns:
- this instance.
- Since:
- 2.18.0
 
- 
acceptAccepts the wildcard specified classes for deserialization, unless they are otherwise rejected.- Parameters:
- patterns- Wildcard file name patterns as defined by- FilenameUtils.wildcardMatch
- Returns:
- this instance.
- Since:
- 2.18.0
 
- 
getBuilds a newValidatingObjectInputStream.You must set an aspect that supports AbstractStreamBuilder.getInputStream()on this builder, otherwise, this method throws an exception.This builder uses the following aspects: - AbstractStreamBuilder.getInputStream()gets the target aspect.
- predicate
- charsetDecoder
- writeImmediately
 - Returns:
- a new instance.
- Throws:
- UnsupportedOperationException- if the origin cannot provide a- InputStream.
- IOException- if an I/O error occurs converting to an- InputStreamusing- AbstractStreamBuilder.getInputStream().
- See Also:
 
- 
getPredicateGets the predicate.- Returns:
- the predicate.
- Since:
- 2.18.0
 
- 
rejectRejects the specified classes for deserialization, even if they are otherwise accepted.- Parameters:
- classes- Classes to reject
- Returns:
- this instance.
- Since:
- 2.18.0
 
- 
rejectRejects class names where the supplied ClassNameMatcher matches for deserialization, even if they are otherwise accepted.- Parameters:
- matcher- the matcher to use
- Returns:
- this instance.
- Since:
- 2.18.0
 
- 
rejectRejects class names that match the supplied pattern for deserialization, even if they are otherwise accepted.- Parameters:
- pattern- standard Java regexp
- Returns:
- this instance.
- Since:
- 2.18.0
 
- 
rejectRejects the wildcard specified classes for deserialization, even if they are otherwise accepted.- Parameters:
- patterns- Wildcard file name patterns as defined by- FilenameUtils.wildcardMatch
- Returns:
- this instance.
- Since:
- 2.18.0
 
- 
setPredicateSets the predicate, null resets to an empty new ObjectStreamClassPredicate.- Parameters:
- predicate- the predicate.
- Returns:
- this instance.
- Since:
- 2.18.0
 
 
- 
ValidatingObjectInputStream.builder().