Package systems.dmx.core.util
Class JavaUtils
- java.lang.Object
-
- systems.dmx.core.util.JavaUtils
-
public class JavaUtils extends Object
Generic Java utilities.
-
-
Constructor Summary
Constructors Constructor Description JavaUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
cookieValue(javax.servlet.http.HttpServletRequest request, String cookieName)
static File
createTempDirectory(String prefix)
static String
decodeURIComponent(String uriComp)
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(String inetAddress)
static BigInteger
inetAddress(InetAddress inetAddress)
static boolean
isInRange(String inetAddress, String range)
static BigInteger
networkMask(int maskNumber, int size)
static BigInteger
networkMask(InetAddress addr, int maskNumber)
static String
random256()
static String
readText(InputStream in)
static String
readTextFile(File file)
static String
readTextURL(URL url)
static String
requestDump(javax.servlet.http.HttpServletRequest request)
static String
requestInfo(javax.servlet.http.HttpServletRequest request)
static String
responseInfo(javax.ws.rs.core.Response.StatusType status)
static String
stripDriveLetter(String path)
static String
stripHTML(String html)
static String
times(String str, int times)
-
-
-
Method Detail
-
readText
public static String readText(InputStream in)
-
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)
-
cookieValue
public static String cookieValue(javax.servlet.http.HttpServletRequest request, String cookieName)
-
requestInfo
public static String requestInfo(javax.servlet.http.HttpServletRequest request)
-
responseInfo
public static String responseInfo(javax.ws.rs.core.Response.StatusType status)
-
requestDump
public static String requestDump(javax.servlet.http.HttpServletRequest request)
-
random256
public static String random256()
-
-