public class MyUtils extends Object
| Constructor and Description |
|---|
MyUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertTc2DateTime(long msec)
Converts time given in milliseconds to a Date string formated as 'yyyy-MM-dd hh:mm:ss.SSS'
|
static String |
convertTc2DateTime(String inputDateTime)
Converts the given date time string from the format 'MM/dd/yyyy hh:mm:ss aa', 'dd/MM/yyyy HH:mm:ss' or 'dd.MM.yyyy hh:mm:ss' to the format 'yyyy-MM-dd
hh:mm:ss.SSS'
|
static long |
convertTcDateTime2MillSec(String inputDateTime)
Converts the given date time String from the format 'MM/dd/yyyy hh:mm:ss aa', 'dd/MM/yyyy HH:mm:ss' or 'dd.MM.yyyy HH:mm:ss' to a time in milli seconds
|
static org.json.JSONObject |
parseJSONFile(File jsonFile,
String encoding)
Opens the given JSON file and returns the content as
JSONObject
If the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading then a FileNotFoundException is thrown. |
static String |
readJSONFile(File jsonFile,
String encoding)
Opens the given JSON file and returns the content as string
If the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading then a FileNotFoundException is thrown. |
public static org.json.JSONObject parseJSONFile(File jsonFile, String encoding) throws FileNotFoundException, IOException
JSONObject
FileNotFoundException is thrown.jsonFile - JSON Fileencoding - The name of a supported charsetJSONObjectFileNotFoundException - if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.IOException - if an I/O error occurspublic static String readJSONFile(File jsonFile, String encoding) throws FileNotFoundException, IOException
FileNotFoundException is thrown.jsonFile - JSON Fileencoding - The name of a supported charsetFileNotFoundException - if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.IOException - if an I/O error occurspublic static String convertTc2DateTime(String inputDateTime)
inputDateTime - Time in the format 'MM/dd/yyyy hh:mm:ss aa', 'dd/MM/yyyy HH:mm:ss' or 'dd.MM.yyyy HH:mm:ss'public static long convertTcDateTime2MillSec(String inputDateTime)
inputDateTime - Time in the format 'MM/dd/yyyy hh:mm:ss aa', 'dd/MM/yyyy HH:mm:ss' or 'dd.MM.yyyy HH:mm:ss'public static String convertTc2DateTime(long msec)
msec - Time in milli secondsCopyright © 2016–2017. All rights reserved.