public class WrapperRepresentation extends Representation
UNKNOWN_SIZE| Constructor and Description | 
|---|
WrapperRepresentation(Representation wrappedRepresentation)
Constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
long | 
exhaust()
Exhaust the content of the representation by reading it and silently
 discarding anything read. 
 | 
long | 
getAvailableSize()
Returns the size effectively available. 
 | 
CharacterSet | 
getCharacterSet()
Returns the character set or null if not applicable. 
 | 
Disposition | 
getDisposition()
Returns the disposition characteristics of the representation. 
 | 
java.util.List<Encoding> | 
getEncodings()
Returns the modifiable list of encodings applied to the entity-body. 
 | 
java.util.Date | 
getExpirationDate()
Returns the future date when this representation expire. 
 | 
java.util.List<Language> | 
getLanguages()
Returns the modifiable list of languages. 
 | 
Reference | 
getLocationRef()
Returns an optional location reference. 
 | 
MediaType | 
getMediaType()
Returns the media type. 
 | 
java.util.Date | 
getModificationDate()
Returns the last date when this representation was modified. 
 | 
java.io.Reader | 
getReader()
Returns a characters reader with the representation's content. 
 | 
long | 
getSize()
Returns the total size in bytes if known, UNKNOWN_SIZE (-1) otherwise. 
 | 
java.io.InputStream | 
getStream()
Returns a stream with the representation's content. 
 | 
Tag | 
getTag()
Returns the tag. 
 | 
java.lang.String | 
getText()
Converts the representation to a string value. 
 | 
Representation | 
getWrappedRepresentation()
Returns the wrapped representation. 
 | 
boolean | 
isAvailable()
Indicates if some fresh content is potentially available, without having
 to actually call one of the content manipulation method like getStream()
 that would actually consume it. 
 | 
boolean | 
isTransient()
Indicates if the representation's content is transient, which means that
 it can be obtained only once. 
 | 
void | 
release()
Releases the representation and all associated objects like streams,
 channels or files which are used to produce its content, transient or
 not. 
 | 
void | 
setAvailable(boolean isAvailable)
Indicates if some fresh content is available. 
 | 
void | 
setCharacterSet(CharacterSet characterSet)
Sets the character set or null if not applicable. 
 | 
void | 
setDisposition(Disposition disposition)
Sets the disposition characteristics of the representation. 
 | 
void | 
setEncodings(java.util.List<Encoding> encodings)
Sets the list of encodings applied to the entity-body. 
 | 
void | 
setExpirationDate(java.util.Date expirationDate)
Sets the future date when this representation expire. 
 | 
void | 
setLanguages(java.util.List<Language> languages)
Sets the list of languages. 
 | 
void | 
setLocationRef(Reference location)
Sets the optional identifier. 
 | 
void | 
setLocationRef(java.lang.String locationUri)
Sets the identifier from a URI string. 
 | 
void | 
setMediaType(MediaType mediaType)
Sets the media type. 
 | 
void | 
setModificationDate(java.util.Date modificationDate)
Sets the last date when this representation was modified. 
 | 
void | 
setSize(long expectedSize)
Sets the expected size in bytes if known, -1 otherwise. 
 | 
void | 
setTag(Tag tag)
Sets the tag. 
 | 
void | 
setTransient(boolean isTransient)
Indicates if the representation's content is transient. 
 | 
append, getRange, hasKnownSize, isEmpty, setRangecreateClientInfo, equals, hashCode, includes, isCompatible, toStringpublic WrapperRepresentation(Representation wrappedRepresentation)
wrappedRepresentation - The wrapped representation.public long exhaust()
             throws java.io.IOException
RepresentationRepresentation.getStream()
 and closes the retrieved stream in the end.exhaust in class Representationjava.io.IOExceptionpublic long getAvailableSize()
RepresentationRepresentation.getSize() if no range is defined, otherwise it returns the size
 of the range using Range.getSize().getAvailableSize in class Representationpublic CharacterSet getCharacterSet()
VariantgetCharacterSet in class Variantpublic Disposition getDisposition()
RepresentationgetDisposition in class Representationpublic java.util.List<Encoding> getEncodings()
VariantgetEncodings in class Variantpublic java.util.Date getExpirationDate()
RepresentationgetExpirationDate in class Representationpublic java.util.List<Language> getLanguages()
VariantgetLanguages in class Variantpublic Reference getLocationRef()
VariantgetLocationRef in class Variantpublic MediaType getMediaType()
VariantgetMediaType in class Variantpublic java.util.Date getModificationDate()
RepresentationInfogetModificationDate in class RepresentationInfopublic java.io.Reader getReader()
                         throws java.io.IOException
RepresentationgetReader in class Representationjava.io.IOExceptionpublic long getSize()
RepresentationRepresentation.getAvailableSize() method.getSize in class RepresentationRepresentation.isEmpty()public java.io.InputStream getStream()
                              throws java.io.IOException
RepresentationgetStream in class Representationjava.io.IOExceptionpublic Tag getTag()
RepresentationInfogetTag in class RepresentationInfopublic java.lang.String getText()
                         throws java.io.IOException
RepresentationgetText in class Representationjava.io.IOExceptionpublic Representation getWrappedRepresentation()
public boolean isAvailable()
RepresentationisAvailable in class Representationpublic boolean isTransient()
RepresentationisTransient in class Representationpublic void release()
RepresentationRepresentation.setAvailable(boolean) method
 with "false" as a value.Representation.exhaust() method or if this
 could be too costly, you should instead explicitly abort the parent
 request and the underlying connections using the Request.abort()
 method or a shortcut one like
 org.restlet.client.resource.ServerResource#abort() or
 Response.abort().release in class Representationpublic void setAvailable(boolean isAvailable)
RepresentationsetAvailable in class RepresentationisAvailable - True if some fresh content is available.public void setCharacterSet(CharacterSet characterSet)
VariantsetCharacterSet in class VariantcharacterSet - The character set or null if not applicable.public void setDisposition(Disposition disposition)
RepresentationsetDisposition in class Representationdisposition - The disposition characteristics of the representation.public void setEncodings(java.util.List<Encoding> encodings)
VariantsetEncodings in class Variantencodings - The list of encodings applied to the entity-body.public void setExpirationDate(java.util.Date expirationDate)
RepresentationsetExpirationDate in class RepresentationexpirationDate - The expiration date.public void setLanguages(java.util.List<Language> languages)
VariantsetLanguages in class Variantlanguages - The list of languages.public void setLocationRef(Reference location)
VariantsetLocationRef in class Variantlocation - The location reference.public void setLocationRef(java.lang.String locationUri)
VariantsetLocationRef in class VariantlocationUri - The location URI to parse.public void setMediaType(MediaType mediaType)
VariantsetMediaType in class VariantmediaType - The media type.public void setModificationDate(java.util.Date modificationDate)
RepresentationInfosetModificationDate in class RepresentationInfomodificationDate - The modification date.public void setSize(long expectedSize)
RepresentationRepresentation.getAvailableSize() method.setSize in class RepresentationexpectedSize - The expected size in bytes if known, -1 otherwise.public void setTag(Tag tag)
RepresentationInfosetTag in class RepresentationInfotag - The tag.public void setTransient(boolean isTransient)
RepresentationsetTransient in class RepresentationisTransient - True if the representation's content is transient.Copyright © 2005-2024 Restlet.