Package org.htmlunit.attachment
Class Attachment
java.lang.Object
org.htmlunit.attachment.Attachment
An attachment represents a page received from the server which contains a
Content-Disposition=attachment
header.-
Constructor Summary
ConstructorsConstructorDescriptionAttachment
(Page page) Creates a new attachment for the specified page.Attachment
(Page page, String attachmentFilename) Creates a new attachment for the specified page. -
Method Summary
Modifier and TypeMethodDescriptiongetPage()
Returns the attached page.Returns the attachment's filename, as suggested by theContent-Disposition
header, ornull
if no filename was suggested.static String
getSuggestedFilename
(String contentDispositionHeader) Returns the attachment's filename, as suggested by theContent-Disposition
header, ornull
if no filename was suggested.
-
Constructor Details
-
Attachment
Creates a new attachment for the specified page.- Parameters:
page
- the attached page
-
Attachment
Creates a new attachment for the specified page.- Parameters:
page
- the attached pageattachmentFilename
- the file name of this attachment
-
-
Method Details
-
getPage
Returns the attached page.- Returns:
- the attached page
-
getSuggestedFilename
Returns the attachment's filename, as suggested by theContent-Disposition
header, ornull
if no filename was suggested.- Returns:
- the attachment's suggested filename, or
null
if none was suggested
-
getSuggestedFilename
Returns the attachment's filename, as suggested by theContent-Disposition
header, ornull
if no filename was suggested.- Parameters:
contentDispositionHeader
- theContent-Disposition
header- Returns:
- the attachment's suggested filename, or
null
if none was suggested
-