Class CachedWriter

    • Field Detail

      • outputLocked

        protected boolean outputLocked
      • currentStream

        protected Writer currentStream
    • Constructor Detail

      • CachedWriter

        public CachedWriter()
      • CachedWriter

        public CachedWriter​(long threshold)
    • Method Detail

      • holdTempFile

        public void holdTempFile()
      • releaseTempFileHold

        public void releaseTempFileHold()
      • doFlush

        protected void doFlush()
                        throws IOException
        Perform any actions required on stream flush (freeze headers, reset output stream ... etc.)
        Throws:
        IOException
      • doClose

        protected void doClose()
                        throws IOException
        Perform any actions required on stream closure (handle response etc.)
        Throws:
        IOException
      • postClose

        protected void postClose()
                          throws IOException
        Perform any actions required after stream closure (close the other related stream etc.)
        Throws:
        IOException
      • lockOutputStream

        public void lockOutputStream()
                              throws IOException
        Locks the output stream to prevent additional writes, but maintains a pointer to it so an InputStream can be obtained
        Throws:
        IOException
      • resetOut

        public void resetOut​(Writer out,
                             boolean copyOldContent)
                      throws IOException
        Replace the original stream with the new one, optionally copying the content of the old one into the new one. When with Attachment, needs to replace the xml writer stream with the stream used by AttachmentSerializer or copy the cached output stream to the "real" output stream, i.e. onto the wire.
        Parameters:
        out - the new output stream
        copyOldContent - flag indicating if the old content should be copied
        Throws:
        IOException
      • size

        public long size()
      • getOut

        public Writer getOut()
        Returns:
        the underlying output stream
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getTempFile

        public File getTempFile()
      • setThreshold

        public void setThreshold​(long threshold)
      • setMaxSize

        public void setMaxSize​(long maxSize)
      • setCipherTransformation

        public void setCipherTransformation​(String cipherTransformation)
      • setDefaultMaxSize

        public static void setDefaultMaxSize​(long l)
      • setDefaultThreshold

        public static void setDefaultThreshold​(int i)
      • setDefaultCipherTransformation

        public static void setDefaultCipherTransformation​(String n)