public class SystemUtils
extends java.lang.Object
Constructor and Description |
---|
SystemUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanupDir(java.lang.String dirPath,
java.util.List<java.lang.String> childdirs)
delete all the files/dirs in the given Directory but dont delete the dir itself.
|
static void |
closeQuietly(javax.management.remote.JMXConnector jmc) |
static void |
closeQuietly(JMXNodeTool tool) |
static void |
createDirs(java.lang.String location) |
static java.lang.String |
getDataFromUrl(java.lang.String url) |
static byte[] |
md5(byte[] buf) |
static java.lang.String |
md5(java.io.File file)
Calculate the MD5 hashsum of the given file.
|
static java.io.BufferedReader |
readFile(java.lang.String absPathToFile) |
static java.lang.String |
toBase64(byte[] md5) |
static java.lang.String |
toHex(byte[] digest) |
static void |
writeToFile(java.lang.String filename,
java.lang.String line) |
public static java.lang.String getDataFromUrl(java.lang.String url)
public static void cleanupDir(java.lang.String dirPath, java.util.List<java.lang.String> childdirs) throws java.io.IOException
dirPath
- The directory path where all the child directories exist.childdirs
- List of child directories to be cleaned up in the dirPathjava.io.IOException
- If there is any error encountered during cleanup.public static void createDirs(java.lang.String location)
public static byte[] md5(byte[] buf)
public static java.lang.String md5(java.io.File file)
file
- File for which md5 checksum should be calculated.public static java.lang.String toHex(byte[] digest)
public static java.lang.String toBase64(byte[] md5)
public static void closeQuietly(JMXNodeTool tool)
public static void closeQuietly(javax.management.remote.JMXConnector jmc)
public static java.io.BufferedReader readFile(java.lang.String absPathToFile) throws java.io.IOException
java.io.IOException
public static void writeToFile(java.lang.String filename, java.lang.String line)