public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static org.json.JSONObject |
file2JSON(File f) |
static String |
getFileExtension(String fileName) |
static String |
getHTTPDateHeaderValue(Date d) |
static String |
getMimeFromFilePath(String path) |
static String |
getResource(String name) |
static void |
main(String[] args) |
static long |
parseLong(String s) |
static byte[] |
readBytesUntilNewLine(InputStream is)
Reads all bytes of a BuferedInputStream untill a NewLine-Char and returns the readed data as a String.
|
static byte[] |
readFile(File f) |
static String |
readUntilNewLine(BufferedInputStream is,
boolean trim)
Reads all bytes of a BuferedInputStream untill a NewLine-Char and returns the readed data as a String.
|
static void |
registerMime(String suffix,
String mime) |
static String |
removeNonEscaped(String src,
char remove,
char escape) |
static String[] |
splitHeader(String header) |
static List<String> |
tokenize(String src,
String separator) |
static List<String> |
tokenizeByIgnoringEnclosure(String src,
char separator,
char enclosure) |
public static void main(String[] args)
public static byte[] readBytesUntilNewLine(InputStream is) throws IOException
is - The InputStreamIOExceptionpublic static String readUntilNewLine(BufferedInputStream is, boolean trim) throws IOException
is - The InputStreamtrim - trims the StringIOExceptionpublic static byte[] readFile(File f)
public static long parseLong(String s)
public static org.json.JSONObject file2JSON(File f) throws IOException, org.json.JSONException
IOExceptionorg.json.JSONExceptionpublic static List<String> tokenizeByIgnoringEnclosure(String src, char separator, char enclosure)
Copyright © 2020 Software Atelier Kamber. All rights reserved.