Package 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 Description MD5SumWatcher(java.io.File watchedFile)
Create a new MD5SumWatcher instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getSum()
Get the current MD5 sum of the watched fileboolean
update()
Detect if the file's MD5 has changed and track its new sum if so
-
-
-
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 existjava.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 existjava.io.IOException
- if the file cannot be read
-
-