Package org.htmlunit

Class DownloadedContent.OnFile

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File file_  
      private boolean temporary_  
    • Constructor Summary

      Constructors 
      Constructor Description
      OnFile​(java.io.File file, boolean temporary)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanUp()
      Clean up resources associated to this content.
      protected void finalize()  
      java.io.InputStream getInputStream()
      Returns a new InputStream allowing to read the downloaded content.
      boolean isEmpty()
      Returns true if the content is empty.
      long length()
      Returns the number of bytes.
      • Methods inherited from class java.lang.Object

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

      • file_

        private final java.io.File file_
      • temporary_

        private final boolean temporary_
    • Constructor Detail

      • OnFile

        OnFile​(java.io.File file,
               boolean temporary)
        Parameters:
        file - the file
        temporary - if true, the file will be deleted when cleanUp() is called.
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Description copied from interface: DownloadedContent
        Returns a new InputStream allowing to read the downloaded content.
        Specified by:
        getInputStream in interface DownloadedContent
        Returns:
        the InputStream
        Throws:
        java.io.IOException - in case of problem accessing the content
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: DownloadedContent
        Returns true if the content is empty.
        Specified by:
        isEmpty in interface DownloadedContent
        Returns:
        true or false
      • finalize

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