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.Attachment
wrapped
The wrappedAttachment
.-
Fields inherited from class de.aristaflow.adept2.ui.htmlgui.HTMLContext.Attachment
cleanup, contentType, data, fileName, headerData, size
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CloseIgnoringAttachment(HTMLContext.Attachment wrapped)
Creates a newAttachment
that ignores closing.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
InputStream
getData()
Deprecated, for removal: This API element is subject to removal in a future version.InputStream
getDataRereadable()
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.InputStream
getInputStream()
Gets the actual data as input stream.HTMLContext.Attachment
unwrap()
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 newAttachment
that ignores closing.- Parameters:
wrapped
- The wrappedAttachment
.
-
-
Method Detail
-
unwrap
public HTMLContext.Attachment unwrap()
Description copied from interface:WrappingProxy
Gets 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 ofWrappingProxy
again.- Specified by:
unwrap
in interfaceWrappingProxy
- Returns:
- The object that is wrapped by a proxy. Since this object has to exist,
null
will 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.Attachment
Gets the actual data as input stream; this is the content of the corresponding body part of the multipart.- Overrides:
getData
in 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.Attachment
Gets 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:
getDataRereadable
in 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 newInputStream
for the attachment data, anIOException
will be thrown.
-
getInputStream
public InputStream getInputStream() throws IOException
Description copied from class:HTMLContext.Attachment
Gets 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:
getInputStream
in 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 newInputStream
for the attachment data, anIOException
will be thrown.
-
getHeaderData
public Map<String,String> getHeaderData()
Description copied from class:HTMLContext.Attachment
Gets 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:
getHeaderData
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classHTMLContext.Attachment
- Throws:
IOException
-
-