Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.jini.url.httpmd
Class HttpmdUtil

    java.lang.Object
      net.jini.url.httpmd.HttpmdUtil

public class HttpmdUtil
extends Object

Provides utility methods for creating and using HTTPMD URLs.

Since:
  2.0

Method Summary
`static String` | `computeDigest(URL url, String algorithm)` Computes the message digest of data specified by a URL.
`static String` | `computeDigestCodebase(String sourceDirectory, String codebase)` Computes the message digests for a codebase with HTTPMD URLs.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### computeDigest

    public static String computeDigest(URL url,
                                       String algorithm)
                                throws IOException,
                                       NoSuchAlgorithmException

  Computes the message digest of data specified by a URL.

  Parameters:
    `url` - the URL of the data
    `algorithm` - the message digest algorithm to use
  Returns:
    the message digest, as a `String` in hexadecimal format
  Throws:
    `IOException` - if an I/O exception occurs while reading data from the URL
    `NoSuchAlgorithmException` - if no provider is found for the message digest algorithm
    `NullPointerException` - if either argument is `null`

### computeDigestCodebase

    public static String computeDigestCodebase(String sourceDirectory,
                                               String codebase)
                                        throws IOException,
                                               MalformedURLException,
                                               NullPointerException

  Computes the message digests for a codebase with HTTPMD URLs.

  Parameters:
    `sourceDirectory` - the name of the directory containing the source files corresponding to the URLs in `codebase`
    `codebase` - a space-separated list of HTTPMD URLs. The digest values specified in the URLs will be ignored. The path portion of the URLs, without the message digest parameters, will be used to specify the source files, relative to `sourceDirectory`, to use for computing message digests.
  Returns:
    the codebase updated to include computed digests
  Throws:
    `IllegalArgumentException` - if any of the URLs in `codebase` fail to specify the HTTPMD protocol
    `IOException` - if an I/O exception occurs while reading data from the source files
    `MalformedURLException` - if any of the URLs in `codebase` have incorrect syntax
    `NullPointerException` - if either argument is `null`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Sun Microsystems, Inc. All rights reserved