Package org.htmlunit
Interface DownloadedContent
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
DownloadedContent.InMemory
,DownloadedContent.OnFile
public interface DownloadedContent extends java.io.Serializable
Wrapper for content downloaded from a remote server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DownloadedContent.InMemory
Implementation keeping content in memory.static class
DownloadedContent.OnFile
Implementation keeping content on the file system.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cleanUp()
Clean up resources associated to this content.java.io.InputStream
getInputStream()
Returns a newInputStream
allowing to read the downloaded content.boolean
isEmpty()
Returns true if the content is empty.long
length()
Returns the number of bytes.
-
-
-
Method Detail
-
getInputStream
java.io.InputStream getInputStream() throws java.io.IOException
Returns a newInputStream
allowing to read the downloaded content.- Returns:
- the InputStream
- Throws:
java.io.IOException
- in case of problem accessing the content
-
cleanUp
void cleanUp()
Clean up resources associated to this content.
-
isEmpty
boolean isEmpty()
Returns true if the content is empty.- Returns:
- true or false
-
length
long length()
Returns the number of bytes.- Returns:
- the length
-
-