public class Conversion extends Object
Constructor and Description |
---|
Conversion() |
Modifier and Type | Method and Description |
---|---|
static int[] |
commaSeparatedStringToIntArray(String commaSeparated)
Parses a comma separated string to a integer array
|
static String |
fileToString(File f)
Reads a file and stores the content in a string
|
static void |
log(String status,
String action,
String message) |
static void |
log(String status,
String action,
String message,
PrintStream writer) |
static File |
stringToTempFile(String string,
String filename,
String format)
Stores a string into a temporarily existing file.
|
static File |
stringToTempFile(String string,
String filename,
String format,
File directory)
Stores a string into a temporarily existing file.
|
static boolean |
validateXML(File xml,
File xsd)
Validates an XML by an XSD
|
public static File stringToTempFile(String string, String filename, String format, File directory) throws IOException
string
- - The string to store in the file.filename
- - The name of the file.format
- - The extension of the file.directory
- - the tmp directoryIOException
- - IO Problempublic static File stringToTempFile(String string, String filename, String format) throws IOException
string
- - The string to store in the file.filename
- - The name of the file.format
- - The extension of the file.IOException
- - IO Problempublic static int[] commaSeparatedStringToIntArray(String commaSeparated) throws NumberFormatException
commaSeparated
- - the comma separated string to parseNumberFormatException
- - Problem parsing an integerpublic static String fileToString(File f) throws IOException
f
- - File pointer to the file that needs to be read. Should be non-binary.IOException
- - IO Problempublic static void log(String status, String action, String message, PrintStream writer)
public static boolean validateXML(File xml, File xsd) throws SAXException, IOException
xml
- - file with xml contentsxsd
- - file with xsd contentsSAXException
- - Something wrong with XML/XSDIOException
- - IO ProblemCopyright © 2019 Leiden University, NL. All rights reserved.