de.deepamehta.core.util
Class JavaUtils

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.util.JavaUtils

public class JavaUtils
extends Object

Generic Java utilities.


Field Summary
private static FileNameMap fileTypeMap
           
 
Constructor Summary
JavaUtils()
           
 
Method Summary
static File createTempDirectory(String prefix)
           
static String decodeURIComponent(String uriComp)
           
private static char[] encodeHex(byte[] data)
           
static String encodeSHA256(String data)
           
static String encodeURIComponent(String uriComp)
           
static File findUnusedFile(File file)
           
static String getBasename(String fileName)
           
static String getExtension(String fileName)
           
static String getFilename(String path)
           
static String getFileType(String fileName)
           
static BigInteger inetAddress(InetAddress inetAddress)
           
static BigInteger inetAddress(String inetAddress)
           
static boolean isInRange(String inetAddress, String range)
           
static BigInteger networkMask(InetAddress addr, int maskNumber)
           
static BigInteger networkMask(int maskNumber, int size)
           
static String readText(InputStream in)
           
static String readTextFile(File file)
           
static String readTextURL(URL url)
           
static String requestInfo(javax.servlet.http.HttpServletRequest request)
           
static String responseInfo(javax.ws.rs.core.Response.Status status)
           
static String stripDriveLetter(String path)
           
static String stripHTML(String html)
           
static String times(String str, int times)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileTypeMap

private static FileNameMap fileTypeMap
Constructor Detail

JavaUtils

public JavaUtils()
Method Detail

stripHTML

public static String stripHTML(String html)

times

public static String times(String str,
                           int times)

getFileType

public static String getFileType(String fileName)

getFilename

public static String getFilename(String path)

getBasename

public static String getBasename(String fileName)

getExtension

public static String getExtension(String fileName)

stripDriveLetter

public static String stripDriveLetter(String path)

findUnusedFile

public static File findUnusedFile(File file)

readTextFile

public static String readTextFile(File file)

readText

public static String readText(InputStream in)

createTempDirectory

public static File createTempDirectory(String prefix)

readTextURL

public static String readTextURL(URL url)

encodeURIComponent

public static String encodeURIComponent(String uriComp)

decodeURIComponent

public static String decodeURIComponent(String uriComp)

isInRange

public static boolean isInRange(String inetAddress,
                                String range)
Parameters:
inetAddress - IPv4 or IPv6 address or a machine name, e.g. "172.68.8.12"
range - IPv4 or IPv6 address range in CIDR notation, e.g. "172.68.8.0/24"

inetAddress

public static BigInteger inetAddress(String inetAddress)

inetAddress

public static BigInteger inetAddress(InetAddress inetAddress)

networkMask

public static BigInteger networkMask(InetAddress addr,
                                     int maskNumber)

networkMask

public static BigInteger networkMask(int maskNumber,
                                     int size)

requestInfo

public static String requestInfo(javax.servlet.http.HttpServletRequest request)

responseInfo

public static String responseInfo(javax.ws.rs.core.Response.Status status)

encodeSHA256

public static String encodeSHA256(String data)

encodeHex

private static char[] encodeHex(byte[] data)


Copyright © 2015. All Rights Reserved.