Skip to content

Instantly share code, notes, and snippets.

@cdsap
Created May 17, 2019 10:12
Show Gist options
  • Save cdsap/c476a88242d3d34719103b81a09d57d0 to your computer and use it in GitHub Desktop.
Save cdsap/c476a88242d3d34719103b81a09d57d0 to your computer and use it in GitHub Desktop.
GenerateMD5
class GenerateMD5 @Inject constructor(
private val sourceFile: File,
private val md5File: File)
: Runnable {
override fun run() {
try {
val stream = FileInputStream(sourceFile)
Thread.sleep(3000)
FileUtils.writeStringToFile(md5File, DigestUtils.md5Hex(stream), null as String?)
} catch (e: Exception) {
throw RuntimeException(e)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment