Package org.htmlunit
Class DownloadedContent.OnFile
java.lang.Object
org.htmlunit.DownloadedContent.OnFile
- All Implemented Interfaces:
Serializable,DownloadedContent
- Enclosing interface:
DownloadedContent
Implementation keeping content on the file system.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.htmlunit.DownloadedContent
DownloadedContent.InMemory, DownloadedContent.OnFile -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp()Clean up resources associated to this content.protected voidfinalize()Returns a newInputStreamallowing to read the downloaded content.booleanisEmpty()Returns true if the content is empty.longlength()Returns the number of bytes.
-
Field Details
-
file_
-
temporary_
private final boolean temporary_
-
-
Constructor Details
-
OnFile
OnFile(File file, boolean temporary) - Parameters:
file- the filetemporary- if true, the file will be deleted when cleanUp() is called.
-
-
Method Details
-
getInputStream
Description copied from interface:DownloadedContentReturns a newInputStreamallowing to read the downloaded content.- Specified by:
getInputStreamin interfaceDownloadedContent- Returns:
- the InputStream
- Throws:
IOException- in case of problem accessing the content
-
cleanUp
public void cleanUp()Description copied from interface:DownloadedContentClean up resources associated to this content.- Specified by:
cleanUpin interfaceDownloadedContent
-
isEmpty
public boolean isEmpty()Description copied from interface:DownloadedContentReturns true if the content is empty.- Specified by:
isEmptyin interfaceDownloadedContent- Returns:
- true or false
-
finalize
-
length
public long length()Description copied from interface:DownloadedContentReturns the number of bytes.- Specified by:
lengthin interfaceDownloadedContent- Returns:
- the length
-