Class ValidatingObjectInputStream

    • Constructor Detail

      • ValidatingObjectInputStream

        public ValidatingObjectInputStream​(InputStream input)
                                    throws IOException
        Constructs an object to deserialize the specified input stream. At least one accept method needs to be called to specify which classes can be deserialized, as by default no classes are accepted.
        Parameters:
        input - an input stream
        Throws:
        IOException - if an I/O error occurs while reading stream header
    • Method Detail

      • accept

        public ValidatingObjectInputStream accept​(Class<?>... classes)
        Accept the specified classes for deserialization, unless they are otherwise rejected.
        Parameters:
        classes - Classes to accept
        Returns:
        this object
      • reject

        public ValidatingObjectInputStream reject​(Class<?>... classes)
        Reject the specified classes for deserialization, even if they are otherwise accepted.
        Parameters:
        classes - Classes to reject
        Returns:
        this object
      • accept

        public ValidatingObjectInputStream accept​(Pattern pattern)
        Accept class names that match the supplied pattern for deserialization, unless they are otherwise rejected.
        Parameters:
        pattern - standard Java regexp
        Returns:
        this object
      • reject

        public ValidatingObjectInputStream reject​(Pattern pattern)
        Reject class names that match the supplied pattern for deserialization, even if they are otherwise accepted.
        Parameters:
        pattern - standard Java regexp
        Returns:
        this object
      • accept

        public ValidatingObjectInputStream accept​(ClassNameMatcher m)
        Accept class names where the supplied ClassNameMatcher matches for deserialization, unless they are otherwise rejected.
        Parameters:
        m - the matcher to use
        Returns:
        this object
      • reject

        public ValidatingObjectInputStream reject​(ClassNameMatcher m)
        Reject class names where the supplied ClassNameMatcher matches for deserialization, even if they are otherwise accepted.
        Parameters:
        m - the matcher to use
        Returns:
        this object