Module jakarta.mail

Class SharedFileInputStream.SharedFile

  • Enclosing class:
    SharedFileInputStream

    static class SharedFileInputStream.SharedFile
    extends java.lang.Object
    A shared class that keeps track of the references to a particular file so it can be closed when the last reference is gone.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int cnt  
      private java.io.RandomAccessFile in  
    • Constructor Summary

      Constructors 
      Constructor Description
      SharedFile​(java.io.File file)  
      SharedFile​(java.lang.String file)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      protected void finalize()  
      void forceClose()  
      java.io.RandomAccessFile open()  
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • cnt

        private int cnt
      • in

        private java.io.RandomAccessFile in
    • Constructor Detail

      • SharedFile

        SharedFile​(java.lang.String file)
            throws java.io.IOException
        Throws:
        java.io.IOException
      • SharedFile

        SharedFile​(java.io.File file)
            throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • open

        public java.io.RandomAccessFile open()
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • forceClose

        public void forceClose()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable