public class RepresentationUtil extends Object
Constructor and Description |
---|
RepresentationUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
closeQuietly(org.restlet.resource.Representation rep)
Attempts to close underlying resources in certain Representation implementations.
|
static org.restlet.resource.Representation |
gzip(org.restlet.resource.Representation rep)
Returns a Representation which will be GZIP encoded.
|
static org.restlet.resource.Representation |
tempFileRepresentation(File tempFile,
org.restlet.data.MediaType mediaType)
Returns a Representation suitable for use with a temporary file (file only alive for the use of this
Representation).
|
public static org.restlet.resource.Representation gzip(org.restlet.resource.Representation rep)
Note, the application must have the "com.noelios.restlet" jar included.
rep
- the Representation
to gzipcom.noelios.restlet.application.EncodeRepresentation
public static org.restlet.resource.Representation tempFileRepresentation(File tempFile, org.restlet.data.MediaType mediaType)
tempFile
- the File
for this representationmediaType
- the media type of the file contentsTempFileRepresentation
(see below)public static void closeQuietly(org.restlet.resource.Representation rep)
rep
- the Representation
to try to quietly close.