| org.restlet.Filter com.noelios.restlet.application.Encoder
Field Summary | |
final public static int | ENCODE_ALL_SIZES Indicates if the encoding should always occur, regardless of the size. |
ENCODE_ALL_SIZES | final public static int ENCODE_ALL_SIZES(Code) | | Indicates if the encoding should always occur, regardless of the size.
|
Encoder | public Encoder(Context context)(Code) | | Constructor using the default media types and with
Encoder.ENCODE_ALL_SIZES setting. This constructor will only encode
response entities after call handling.
Parameters: context - The context. |
Encoder | public Encoder(Context context, boolean encodeInput, boolean encodeOutput, long minimumSize, List<MediaType> acceptedMediaTypes, List<MediaType> ignoredMediaTypes)(Code) | | Constructor.
Parameters: context - The context. Parameters: encodeInput - Indicates if the request entities should be encoded. Parameters: encodeOutput - Indicates if the response entities should be encoded. Parameters: minimumSize - The minimal size of the representation where compressionshould be used. Parameters: acceptedMediaTypes - The media types that should be encoded. Parameters: ignoredMediaTypes - The media types that should be ignored. |
afterHandle | public void afterHandle(Request request, Response response)(Code) | | Allows filtering after its handling by the target Restlet. Does nothing
by default.
Parameters: request - The request to filter. Parameters: response - The response to filter. |
beforeHandle | public void beforeHandle(Request request, Response response)(Code) | | Allows filtering before its handling by the target Restlet. Does nothing
by default.
Parameters: request - The request to filter. Parameters: response - The response to filter. |
canEncode | public boolean canEncode(Representation representation)(Code) | | Indicates if a representation can be encoded.
Parameters: representation - The representation to test. True if the call can be encoded. |
encode | public Representation encode(ClientInfo client, Representation representation)(Code) | | Encodes a given representation if an encoding is supported by the client.
Parameters: client - The client preferences to use. Parameters: representation - The representation to encode. The encoded representation or the original one if no encodingsupported by the client. |
getAcceptedMediaTypes | public List<MediaType> getAcceptedMediaTypes()(Code) | | Returns the media types that should be encoded.
The media types that should be encoded. |
getBestEncoding | public Encoding getBestEncoding(ClientInfo client)(Code) | | Returns the best supported encoding for a given client.
Parameters: client - The client preferences to use. The best supported encoding for the given call. |
getDefaultAcceptedMediaTypes | public static List<MediaType> getDefaultAcceptedMediaTypes()(Code) | | Returns the list of default encoded media types. This can be overriden by
subclasses. By default, all media types are encoded (except those
explicitely ignored).
The list of default encoded media types. |
getDefaultIgnoredMediaTypes | public static List<MediaType> getDefaultIgnoredMediaTypes()(Code) | | Returns the list of default ignored media types. This can be overriden by
subclasses. By default, all archive, audio, image and video media types
are ignored.
The list of default ignored media types. |
getIgnoredMediaTypes | public List<MediaType> getIgnoredMediaTypes()(Code) | | Returns the media types that should be ignored.
The media types that should be ignored. |
getMinimumSize | public long getMinimumSize()(Code) | | Returns the minimum size a representation must have before compression is
done.
The minimum size a representation must have before compression isdone. |
isEncodeRequest | public boolean isEncodeRequest()(Code) | | Indicates if the request entity should be encoded.
True if the request entity should be encoded. |
isEncodeResponse | public boolean isEncodeResponse()(Code) | | Indicates if the response entity should be encoded.
True if the response entity should be encoded. |
setEncodeRequest | public void setEncodeRequest(boolean encodeRequest)(Code) | | Indicates if the request entity should be encoded.
Parameters: encodeRequest - True if the request entity should be encoded. |
setEncodeResponse | public void setEncodeResponse(boolean encodeResponse)(Code) | | Indicates if the response entity should be encoded.
Parameters: encodeResponse - True if the response entity should be encoded. |
setMinimumSize | public void setMinimumSize(long mininumSize)(Code) | | Sets the minimum size a representation must have before compression is
done.
Parameters: mininumSize - The minimum size a representation must have before compressionis done. |
|
|