Class TeeWriter

  • All Implemented Interfaces:
    Closeable, Flushable, Appendable, AutoCloseable

    public final class TeeWriter
    extends Writer
    Executes the actions on a single writer to multiple writers. If the list of writers in the constructor is empty everything that is written will be discarted. If there is thrown one or more exception all writers will still be accessed, the exceptions will be logged and the last exception thrown will be passed on outside.
    • Field Detail

      • LOG

        private static final org.apache.commons.logging.Log LOG
      • writers

        private final Writer[] writers
    • Constructor Detail

      • TeeWriter

        public TeeWriter()
        Create a writer that doesn't do anything.
      • TeeWriter

        public TeeWriter​(Writer... writers)
        Create a single writer that writes to multiple writers.
        Parameters:
        writers - the list of writers that should be written to.