public class SerialUIDChanger extends Object implements RevisionHandler
| Constructor and Description |
|---|
SerialUIDChanger() |
| Modifier and Type | Method and Description |
|---|---|
static void |
binaryToKOML(String binary,
String koml)
converts a binary file into a KOML XML file
|
static void |
changeUID(long oldUID,
long newUID,
String fromFile,
String toFile)
changes the oldUID into newUID from the given file (binary/KOML) into the
other one (binary/KOML).
|
protected static boolean |
checkKOML()
checks whether KOML is present
|
String |
getRevision()
Returns the revision string.
|
static boolean |
isKOML(String filename)
checks whether the given filename ends with ".koml"
|
static void |
komlToBinary(String koml,
String binary)
converts a KOML file into a binary one
|
static void |
main(String[] args)
exchanges an old UID for a new one.
|
protected static Object |
readBinary(String binary)
loads a serialized object and returns it
|
protected static void |
writeBinary(String binary,
Object o)
serializes the given object into the given file
|
protected static boolean checkKOML()
throws Exception
true if KOML is presentException - if KOML is not presentpublic static boolean isKOML(String filename)
filename - the filename to checkKOML.FILE_EXTENSIONprotected static Object readBinary(String binary) throws Exception
binary - the filename that points to the file containing the
serialized objectException - if reading failsprotected static void writeBinary(String binary, Object o) throws Exception
binary - the file to store the object ino - the object to serializeException - if saving failspublic static void binaryToKOML(String binary, String koml) throws Exception
binary - the binary file to convertkoml - where to store the XML outputException - if conversion failspublic static void komlToBinary(String koml, String binary) throws Exception
koml - the filename with the XML databinary - the name of theExceptionpublic static void changeUID(long oldUID,
long newUID,
String fromFile,
String toFile)
throws Exception
oldUID - the old UID to changenewUID - the new UID to usefromFile - the original file with the old UIDtoFile - the new file where to store the modified UIDException - if conversion failspublic String getRevision()
getRevision in interface RevisionHandlerpublic static void main(String[] args) throws Exception
args - the command line parametersExceptionKOML.FILE_EXTENSIONCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.