Modifier and Type | Field and Description |
---|---|
private static FileNameMap |
fileTypeMap |
Constructor and Description |
---|
JavaUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
cookieValue(javax.servlet.http.HttpServletRequest request,
String cookieName) |
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 |
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) |
private static FileNameMap fileTypeMap
public JavaUtils()
public static String getFileType(String fileName)
public static String getFilename(String path)
public static String getBasename(String fileName)
public static String getExtension(String fileName)
public static String stripDriveLetter(String path)
public static File findUnusedFile(File file)
public static String readTextFile(File file)
public static String readText(InputStream in)
public static File createTempDirectory(String prefix)
public static String readTextURL(URL url)
public static String encodeURIComponent(String uriComp)
public static String decodeURIComponent(String uriComp)
public static boolean isInRange(String inetAddress, String range)
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"public static BigInteger inetAddress(String inetAddress)
public static BigInteger inetAddress(InetAddress inetAddress)
public static BigInteger networkMask(InetAddress addr, int maskNumber)
public static BigInteger networkMask(int maskNumber, int size)
public static String cookieValue(javax.servlet.http.HttpServletRequest request, String cookieName)
public static String requestInfo(javax.servlet.http.HttpServletRequest request)
public static String responseInfo(javax.ws.rs.core.Response.StatusType status)
public static String requestDump(javax.servlet.http.HttpServletRequest request)
public static String encodeSHA256(String data)
private static char[] encodeHex(byte[] data)
Copyright © 2018. All Rights Reserved.