public final class Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static MediaType |
getContentType(Path file)
Returns the MIME-Type of an file.
|
static String |
getExtension(Path file)
Extract the extension from the file.
|
static String |
getGMTDate(Date date) |
static String |
getYourIp() |
static String |
randomToken(int byteLength,
int radix)
Generates an random token with SecureRandom
|
static String |
streamToString(InputStream is)
Write all data from an InputStream in an String
|
public static String streamToString(InputStream is)
is - The source InputStreampublic static MediaType getContentType(Path file)
file - The file.public static String randomToken(int byteLength, int radix)
byteLength - The token lengthradix - The basepublic static String getYourIp() throws UnknownHostException
UnknownHostException - If resolving failspublic static String getExtension(Path file)
file - The file.Copyright © 2019. All rights reserved.