dioscuri.util
Class Utilities

java.lang.Object
  extended by dioscuri.util.Utilities

public final class Utilities
extends java.lang.Object

Utility class

Author:
Bart Kiers

Method Summary
static java.io.File resolvePathAsFile(java.lang.String path)
          Resolves a path: if path exists, a File is directly constructed of it.
static java.lang.String resolvePathAsString(java.lang.String path)
          Resolves a path: if path exists, it's directly returned.
static boolean saveXML(dioscuri.config.Emulator emuObject, java.lang.String path)
          Saves the settings of an dioscuri.config.Emulator object to the file denoted by path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

resolvePathAsString

public static java.lang.String resolvePathAsString(java.lang.String path)
Resolves a path: if path exists, it's directly returned. Else, the execution folder of the Dioscuri JAR is prepend to path and then the absolute path of that File is returned

Parameters:
path - the relative or absolute path of a file
Returns:
the absolute path of a file denoted by the relative- or absolute path (the parameter)
See Also:
Utilities#resolvePathAsFile(String)

resolvePathAsFile

public static java.io.File resolvePathAsFile(java.lang.String path)
Resolves a path: if path exists, a File is directly constructed of it. Else, the execution folder of the Dioscuri JAR is prepend to path and then a File is constructed and returned

Parameters:
path - the relative or absolute path of a file
Returns:
if path exists, a File is directly constructed of it. Else, the execution folder of the Dioscuri JAR is prepend to path and then a File is directly constructed and returned
See Also:
Utilities#resolvePathAsString(String)

saveXML

public static boolean saveXML(dioscuri.config.Emulator emuObject,
                              java.lang.String path)
Saves the settings of an dioscuri.config.Emulator object to the file denoted by path.

Parameters:
emuObject - the settings to be saved
path - the path of the XML config file
Returns:
true if the settings from dioscuri.config.Emulator are successfully saved in path, else false