DigesterRepresentation instead.@Deprecated public abstract class DigestRepresentation extends WrapperRepresentation
Representation.isTransient().UNKNOWN_SIZE| Constructor and Description |
|---|
DigestRepresentation(Representation wrappedRepresentation)
Deprecated.
Constructor.
By default, the instance relies on the Digest.ALGORITHM_MD5
digest algorithm. |
DigestRepresentation(Representation wrappedRepresentation,
java.lang.String algorithm)
Deprecated.
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkDigest()
Deprecated.
Check that the digest computed from the wrapped representation content
and the digest declared by the wrapped representation are the same.
|
boolean |
checkDigest(java.lang.String algorithm)
Deprecated.
Check that the digest computed from the representation content and the
digest declared by the representation are the same.
|
Digest |
computeDigest(java.lang.String algorithm)
Deprecated.
Compute the representation digest according to the given algorithm.
Since this method reads entirely the representation's stream, user must take care of the content of the representation in case the latter is transient. |
java.nio.channels.ReadableByteChannel |
getChannel()
Deprecated.
Returns a channel with the representation's content.
If it is supported by a file, a read-only instance of FileChannel is returned. This method is ensured to return a fresh channel for each invocation unless it is a transient representation, in which case null is returned. |
Digest |
getComputedDigest()
Deprecated.
Returns the current computed digest value of the representation.
|
java.io.Reader |
getReader()
Deprecated.
Returns a characters reader with the representation's content.
|
java.io.InputStream |
getStream()
Deprecated.
Returns a stream with the representation's content.
|
java.lang.String |
getText()
Deprecated.
Converts the representation to a string value.
|
void |
write(java.io.OutputStream outputStream)
Deprecated.
Writes the representation to a byte stream.
|
void |
write(java.nio.channels.WritableByteChannel writableChannel)
Deprecated.
Writes the representation to a byte channel.
|
void |
write(java.io.Writer writer)
Deprecated.
Writes the representation to a characters writer.
|
exhaust, getAvailableSize, getCharacterSet, getDigest, getDisposition, getDownloadName, getEncodings, getExpirationDate, getIdentifier, getLanguages, getLocationRef, getMediaType, getModificationDate, getRange, getSize, getTag, getWrappedRepresentation, isAvailable, isDownloadable, isTransient, release, setAvailable, setCharacterSet, setDigest, setDisposition, setDownloadable, setDownloadName, setEncodings, setExpirationDate, setIdentifier, setIdentifier, setLanguages, setLocationRef, setLocationRef, setMediaType, setModificationDate, setRange, setSize, setTag, setTransientcreateEmptycreateClientInfo, equals, includes, isCompatible, toStringpublic DigestRepresentation(Representation wrappedRepresentation) throws java.security.NoSuchAlgorithmException
Digest.ALGORITHM_MD5
digest algorithm.wrappedRepresentation - The wrapped representation.java.security.NoSuchAlgorithmExceptionpublic DigestRepresentation(Representation wrappedRepresentation, java.lang.String algorithm) throws java.security.NoSuchAlgorithmException
wrappedRepresentation - The wrapped representation.algorithm - The digest algorithmjava.security.NoSuchAlgorithmExceptionpublic boolean checkDigest()
checkDigest in class WrapperRepresentationpublic boolean checkDigest(java.lang.String algorithm)
Representation.computeDigest(String) method,
and since this method reads entirely the representation's stream, user
must take care of the content of the representation in case the latter is
transient.
Representation.isTransient checkDigest in class WrapperRepresentationalgorithm - The algorithm used to compute the digest to compare with. See
constant values in Digest.public Digest computeDigest(java.lang.String algorithm)
Representation.isTransient computeDigest in class WrapperRepresentationalgorithm - The algorithm used to compute the digest. See constant values
in Digest.public java.nio.channels.ReadableByteChannel getChannel()
throws java.io.IOException
RepresentationgetChannel in class WrapperRepresentationjava.io.IOExceptionpublic Digest getComputedDigest()
public java.io.Reader getReader()
throws java.io.IOException
RepresentationgetReader in class WrapperRepresentationjava.io.IOExceptionpublic java.io.InputStream getStream()
throws java.io.IOException
DigestInputStream class, which allows to compute
progressively the digest value.getStream in class WrapperRepresentationjava.io.IOExceptionpublic java.lang.String getText()
throws java.io.IOException
RepresentationgetText in class WrapperRepresentationjava.io.IOExceptionpublic void write(java.io.OutputStream outputStream)
throws java.io.IOException
OutputStream after writing to it as this will be handled by
the Restlet connectors automatically.DigestOutputStream class, which allows to compute progressively
the digest value.write in class WrapperRepresentationoutputStream - The output stream.java.io.IOExceptionpublic void write(java.nio.channels.WritableByteChannel writableChannel)
throws java.io.IOException
Representationwrite in class WrapperRepresentationwritableChannel - A writable byte channel.java.io.IOExceptionpublic void write(java.io.Writer writer)
throws java.io.IOException
RepresentationWriter after writing to it as this will be handled
by the Restlet connectors automatically.write in class WrapperRepresentationwriter - The characters writer.java.io.IOExceptionCopyright © 2005-2012. All Rights Reserved.