Class TempSharedFileInputStream

  • All Implemented Interfaces:
    jakarta.mail.internet.SharedInputStream, Closeable, AutoCloseable

    public class TempSharedFileInputStream
    extends jakarta.mail.util.SharedFileInputStream
    Stores the content of the input InputStream in a temporary file, and opens SharedFileInputStream on that file. When the stream is closed, the file will be deleted, and the input stream will be closed.
    • Method Detail

      • close

        public void close()
                   throws IOException
        close - Do nothing, to prevent early close, as the cryptographic processing stages closes their input stream
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Overrides:
        close in class jakarta.mail.util.SharedFileInputStream
        Throws:
        IOException
      • finalize

        protected void finalize()
                         throws Throwable
        finalize - closes also the input stream, and deletes the backing file
        Overrides:
        finalize in class jakarta.mail.util.SharedFileInputStream
        Throws:
        Throwable
      • closeAndDelete

        public void closeAndDelete()
                            throws IOException
        closeAll - closes the input stream, and deletes the backing file
        Throws:
        IOException - in case of error
        Since:
        4.10.2