Package de.aristaflow.adept2.ui.htmlgui
Class HTMLContext.CloseIgnoringAttachment
- java.lang.Object
-
- de.aristaflow.adept2.ui.htmlgui.HTMLContext.Attachment
-
- de.aristaflow.adept2.ui.htmlgui.HTMLContext.CloseIgnoringAttachment
-
- All Implemented Interfaces:
WrappingProxy,Closeable,AutoCloseable
- Enclosing interface:
- HTMLContext
public static class HTMLContext.CloseIgnoringAttachment extends HTMLContext.Attachment implements WrappingProxy
-
-
Field Summary
Fields Modifier and Type Field Description protected HTMLContext.AttachmentwrappedThe wrappedAttachment.-
Fields inherited from class de.aristaflow.adept2.ui.htmlgui.HTMLContext.Attachment
cleanup, contentType, data, fileName, headerData, size
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCloseIgnoringAttachment(HTMLContext.Attachment wrapped)Creates a newAttachmentthat ignores closing.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()InputStreamgetData()Deprecated, for removal: This API element is subject to removal in a future version.InputStreamgetDataRereadable()Deprecated, for removal: This API element is subject to removal in a future version.Map<String,String>getHeaderData()Gets all header data which is sent with the body part of the multipart this attachment stems from.InputStreamgetInputStream()Gets the actual data as input stream.HTMLContext.Attachmentunwrap()Gets the object instance that is wrapped by this proxy.-
Methods inherited from class de.aristaflow.adept2.ui.htmlgui.HTMLContext.Attachment
getContentType, getFileName, getSize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.aristaflow.adept2.model.common.WrappingProxy
isWrapperFor, unwrap
-
-
-
-
Field Detail
-
wrapped
protected final HTMLContext.Attachment wrapped
The wrappedAttachment.
-
-
Constructor Detail
-
CloseIgnoringAttachment
protected CloseIgnoringAttachment(HTMLContext.Attachment wrapped)
Creates a newAttachmentthat ignores closing.- Parameters:
wrapped- The wrappedAttachment.
-
-
Method Detail
-
unwrap
public HTMLContext.Attachment unwrap()
Description copied from interface:WrappingProxyGets the object instance that is wrapped by this proxy. This simply unwraps, so there are no type checks. In case of a cascaded proxy, this may even be an instance ofWrappingProxyagain.- Specified by:
unwrapin interfaceWrappingProxy- Returns:
- The object that is wrapped by a proxy. Since this object has to exist,
nullwill never be returned.
-
getData
@Deprecated(since="15.0.0", forRemoval=true) public InputStream getData()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:HTMLContext.AttachmentGets the actual data as input stream; this is the content of the corresponding body part of the multipart.- Overrides:
getDatain classHTMLContext.Attachment- Returns:
- The actual data of this attachment as provided as content of the body part.
-
getDataRereadable
@Deprecated(since="15.0.0", forRemoval=true) public InputStream getDataRereadable() throws IOException
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:HTMLContext.AttachmentGets the actual data as input stream. This method can be called several times returning the same input for every call.
Users have toInputStream.close()the returned stream!- Overrides:
getDataRereadablein classHTMLContext.Attachment- Returns:
- The actual data of this attachment as provided as content of the body part. The caller is responsible for closing.
- Throws:
IOException- If there are problems creating a newInputStreamfor the attachment data, anIOExceptionwill be thrown.
-
getInputStream
public InputStream getInputStream() throws IOException
Description copied from class:HTMLContext.AttachmentGets the actual data as input stream. This method can be called several times returning the same input for every call.
Users have toInputStream.close()the returned stream!- Overrides:
getInputStreamin classHTMLContext.Attachment- Returns:
- The actual data of this attachment as provided as content of the body part. The caller is responsible for closing.
- Throws:
IOException- If there are problems creating a newInputStreamfor the attachment data, anIOExceptionwill be thrown.
-
getHeaderData
public Map<String,String> getHeaderData()
Description copied from class:HTMLContext.AttachmentGets all header data which is sent with the body part of the multipart this attachment stems from. The values of the header data may be arbitrary strings even containing key-value-pairs again. However, they are just provided as from the body part.- Overrides:
getHeaderDatain classHTMLContext.Attachment- Returns:
- All header data (mapping from header name to value) which is sent with the body part of the multipart this attachment stems from.
- See Also:
Header
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classHTMLContext.Attachment- Throws:
IOException
-
-