public class SerialUIDChanger extends java.lang.Object implements RevisionHandler
| Constructor and Description |
|---|
SerialUIDChanger() |
| Modifier and Type | Method and Description |
|---|---|
static void |
binaryToKOML(java.lang.String binary,
java.lang.String koml)
converts a binary file into a KOML XML file
|
static void |
changeUID(long oldUID,
long newUID,
java.lang.String fromFile,
java.lang.String toFile)
changes the oldUID into newUID from the given file (binary/KOML) into the
other one (binary/KOML). it basically does a replace in the XML, i.e. it
looks for " uid='oldUID'" and replaces it with " uid='newUID'".
|
protected static boolean |
checkKOML()
checks whether KOML is present
|
java.lang.String |
getRevision()
Returns the revision string.
|
static boolean |
isKOML(java.lang.String filename)
checks whether the given filename ends with ".koml"
|
static void |
komlToBinary(java.lang.String koml,
java.lang.String binary)
converts a KOML file into a binary one
|
static void |
main(java.lang.String[] args)
exchanges an old UID for a new one. a file that doesn't end with ".koml"
is considered being binary.
|
protected static java.lang.Object |
readBinary(java.lang.String binary)
loads a serialized object and returns it
|
protected static void |
writeBinary(java.lang.String binary,
java.lang.Object o)
serializes the given object into the given file
|
protected static boolean checkKOML()
throws java.lang.Exception
true if KOML is presentjava.lang.Exception - if KOML is not presentpublic static boolean isKOML(java.lang.String filename)
filename - the filename to checkKOML.FILE_EXTENSIONprotected static java.lang.Object readBinary(java.lang.String binary)
throws java.lang.Exception
binary - the filename that points to the file containing the
serialized objectjava.lang.Exception - if reading failsprotected static void writeBinary(java.lang.String binary,
java.lang.Object o)
throws java.lang.Exception
binary - the file to store the object ino - the object to serializejava.lang.Exception - if saving failspublic static void binaryToKOML(java.lang.String binary,
java.lang.String koml)
throws java.lang.Exception
binary - the binary file to convertkoml - where to store the XML outputjava.lang.Exception - if conversion failspublic static void komlToBinary(java.lang.String koml,
java.lang.String binary)
throws java.lang.Exception
koml - the filename with the XML databinary - the name of thejava.lang.Exceptionpublic static void changeUID(long oldUID,
long newUID,
java.lang.String fromFile,
java.lang.String toFile)
throws java.lang.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 UIDjava.lang.Exception - if conversion failspublic java.lang.String getRevision()
getRevision in interface RevisionHandlerpublic static void main(java.lang.String[] args)
throws java.lang.Exception
args - the command line parametersjava.lang.ExceptionKOML.FILE_EXTENSION