Package org.jclouds.io.payloads
Class BasePayload<V>
- java.lang.Object
-
- org.jclouds.io.payloads.BasePayload<V>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Payload
- Direct Known Subclasses:
ApacheHCUtils.HttpEntityPayload,ByteArrayPayload,ByteSourcePayload,ChunkedUploadPayload,FilePayload,InputStreamPayload,MultipartForm,PhantomPayload,StringPayload,UrlEncodedFormPayload
public abstract class BasePayload<V> extends Object implements Payload
-
-
Field Summary
Fields Modifier and Type Field Description protected Vcontentprotected MutableContentMetadatacontentMetadataprotected booleanwritten
-
Constructor Summary
Constructors Modifier Constructor Description protectedBasePayload(V content)protectedBasePayload(V content, MutableContentMetadata contentMetadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Delegates to release()booleanequals(Object obj)MutableContentMetadatagetContentMetadata()InputStreamgetInput()Creates a new InputStream object of the payload.VgetRawContent()Payload in its original form.inthashCode()booleanisRepeatable()By default we are repeatable.booleanisSensitive()Returns whether the payload contains sensitive information.voidrelease()By default there are no resources to release.voidsetContentMetadata(MutableContentMetadata in)voidsetSensitive(boolean isSensitive)Sets whether the payload contains sensitive information.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jclouds.io.Payload
openStream
-
-
-
-
Field Detail
-
content
protected final V content
-
written
protected transient volatile boolean written
-
contentMetadata
protected MutableContentMetadata contentMetadata
-
-
Constructor Detail
-
BasePayload
protected BasePayload(V content)
-
BasePayload
protected BasePayload(V content, MutableContentMetadata contentMetadata)
-
-
Method Detail
-
getInput
public InputStream getInput()
Description copied from interface:PayloadCreates a new InputStream object of the payload.
-
getRawContent
public V getRawContent()
Payload in its original form.- Specified by:
getRawContentin interfacePayload
-
isRepeatable
public boolean isRepeatable()
By default we are repeatable.- Specified by:
isRepeatablein interfacePayload
-
release
public void release()
By default there are no resources to release.
-
close
public void close()
Delegates to release()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getContentMetadata
public MutableContentMetadata getContentMetadata()
- Specified by:
getContentMetadatain interfacePayload
-
setContentMetadata
public void setContentMetadata(MutableContentMetadata in)
- Specified by:
setContentMetadatain interfacePayload
-
setSensitive
public void setSensitive(boolean isSensitive)
Description copied from interface:PayloadSets whether the payload contains sensitive information. This is used when trying to decide whether to print out the payload information or not in logs- Specified by:
setSensitivein interfacePayload
-
isSensitive
public boolean isSensitive()
Description copied from interface:PayloadReturns whether the payload contains sensitive information. This is used when trying to decide whether to print out the payload information or not in logs- Specified by:
isSensitivein interfacePayload
-
-