Package org.restlet.data

Examples of org.restlet.data.Digest


     * {@link #isTransient}
     *
     * @return True if both digests are not null and equals.
     */
    public boolean checkDigest() {
        Digest digest = getDigest();
        return (digest != null && digest.equals(getComputedDigest()));
    }
View Full Code Here


        boolean result = false;

        if (this.algorithm != null && this.algorithm.equals(algorithm)) {
            result = checkDigest();
        } else {
            Digest digest = getDigest();

            if (digest != null) {
                if (algorithm.equals(digest.getAlgorithm())) {
                    result = digest.equals(computeDigest(algorithm));
                }
            }
        }

        return result;
View Full Code Here

     *            The algorithm used to compute the digest. See constant values
     *            in {@link org.restlet.data.Digest}.
     * @return The computed digest or null if the digest cannot be computed.
     */
    public Digest computeDigest(String algorithm) {
        Digest result = null;

        if (this.algorithm != null && this.algorithm.equals(algorithm)) {
            result = getComputedDigest();
        } else if (isAvailable()) {
            try {
View Full Code Here

     * written, the computed digest value may not be accurate.
     *
     * @return The current computed digest value.
     */
    public Digest getComputedDigest() {
        return new Digest(this.algorithm, computedDigest.digest());
    }
View Full Code Here

            } else if (header.getName().equalsIgnoreCase(
                    HeaderConstants.HEADER_CONTENT_RANGE)) {
                RangeReader.update(header.getValue(), result);
            } else if (header.getName().equalsIgnoreCase(
                    HeaderConstants.HEADER_CONTENT_MD5)) {
                result.setDigest(new Digest(Digest.ALGORITHM_MD5, Base64
                        .decode(header.getValue())));
            } else if (header.getName().equalsIgnoreCase(
                    HeaderConstants.HEADER_CONTENT_DISPOSITION)) {
                try {
                    result.setDisposition(new DispositionReader(header
View Full Code Here

            } else if (header.getName().equalsIgnoreCase(
                    HttpConstants.HEADER_CONTENT_RANGE)) {
                RangeUtils.parseContentRange(header.getValue(), result);
            } else if (header.getName().equalsIgnoreCase(
                    HttpConstants.HEADER_CONTENT_MD5)) {
                result.setDigest(new Digest(Digest.ALGORITHM_MD5, Base64
                        .decode(header.getValue())));
            }
        }

        return result;
View Full Code Here

            } else if (header.getName().equalsIgnoreCase(
                    HttpConstants.HEADER_CONTENT_RANGE)) {
                RangeUtils.parseContentRange(header.getValue(), result);
            } else if (header.getName().equalsIgnoreCase(
                    HttpConstants.HEADER_CONTENT_MD5)) {
                result.setDigest(new Digest(Digest.ALGORITHM_MD5, Base64
                        .decode(header.getValue())));
            }
        }

        return result;
View Full Code Here

                    HttpConstants.HEADER_CONTENT_RANGE)) {
                RangeUtils.parseContentRange(header.getValue(), result);
                entityHeaderFound = true;
            } else if (header.getName().equalsIgnoreCase(
                    HttpConstants.HEADER_CONTENT_MD5)) {
                result.setDigest(new Digest(Digest.ALGORITHM_MD5, Base64
                        .decode(header.getValue())));
                entityHeaderFound = true;
            }

        }
View Full Code Here

TOP

Related Classes of org.restlet.data.Digest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.