MD5SumWatcher (IcedTea-Web: NetX )
Keywords: net.sourceforge.jnlp.util.MD5SumWatcher class
Date: 2016-05-12

net.sourceforge.jnlp.util

## Class MD5SumWatcher

- java.lang.Object
- - net.sourceforge.jnlp.util.MD5SumWatcher

-     public class MD5SumWatcher
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MD5SumWatcher(java.io.File watchedFile)` Create a new MD5SumWatcher instance

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getSum()` Get the current MD5 sum of the watched file
    `boolean` | `update()` Detect if the file's MD5 has changed and track its new sum if so

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MD5SumWatcher

          public MD5SumWatcher(java.io.File watchedFile)

      Create a new MD5SumWatcher instance
      Parameters:
        `watchedFile` - the file to watch

  - ### Method Detail

    - #### getSum

          public byte[] getSum()
                        throws java.io.FileNotFoundException,
                               java.io.IOException

      Get the current MD5 sum of the watched file
      Returns:
        a byte array of the MD5 sum
      Throws:
        `java.io.FileNotFoundException` - if the watched file does not exist
        `java.io.IOException` - if the file cannot be read

    - #### update

          public boolean update()
                         throws java.io.FileNotFoundException,
                                java.io.IOException

      Detect if the file's MD5 has changed and track its new sum if so
      Returns:
        if the file's MD5 has changed since the last update
      Throws:
        `java.io.FileNotFoundException` - if the watched file does not exist
        `java.io.IOException` - if the file cannot be read

Submit a bug or feature