From ca4f3f9caeb903a5a446da6b96350d008edb9034 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 19 Feb 1999 13:11:47 +0000 Subject: [PATCH] save table in properties readTable implemented git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@286 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/obfuscator/ClassBundle.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/jode/jode/obfuscator/ClassBundle.java b/jode/jode/obfuscator/ClassBundle.java index e2a2116..cdbb354 100644 --- a/jode/jode/obfuscator/ClassBundle.java +++ b/jode/jode/obfuscator/ClassBundle.java @@ -72,12 +72,24 @@ public class ClassBundle { } public void readTable(String filename) { + Properties prop = new Properties(); + try { + InputStream input = new FileInputStream(filename); + prop.load(input); + input.close(); + } catch (java.io.IOException ex) { + Obfuscator.err.println("Can't read rename table "+filename); + ex.printStackTrace(); + } + basePackage.readTable(prop); } public void writeTable(String filename) { + Properties prop = new Properties(); + basePackage.writeTable(prop); try { - PrintWriter out = new PrintWriter(new FileOutputStream(filename)); - basePackage.writeTable(out); + OutputStream out = new FileOutputStream(filename); + prop.save(out, "Reverse renaming table"); out.close(); } catch (java.io.IOException ex) { Obfuscator.err.println("Can't write rename table "+filename); @@ -90,6 +102,7 @@ public class ClassBundle { if (!directory.exists()) { Obfuscator.err.println("Destination directory " +directory.getPath()+" doesn't exists."); + return; } basePackage.storeClasses(new File(destination)); }