00001 import java.io.File;
00002 import java.io.FileInputStream;
00003 import java.io.FileNotFoundException;
00004 import java.io.FileOutputStream;
00005 import java.io.IOException;
00006
00007 import edu.tum.cs.srldb.Database;
00008 import edu.tum.cs.srldb.datadict.DDAttribute;
00009
00010
00011
00012
00013
00014
00015
00016
00017 public class fixSRLDB {
00018
00025 public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException {
00026 File dir = new File(".");
00027 String[] files = dir.list();
00028 for(String file : files) {
00029 if(file.endsWith(".srldb")) {
00030 System.out.println(file);
00031 Database db = Database.fromFile(new FileInputStream(new File(file)));
00032
00033 for(DDAttribute dda : db.getDataDictionary().getAttributes())
00034 if(dda.isDiscarded())
00035 dda.discard();
00036
00037 db.writeSRLDB(new FileOutputStream(new File(file)));
00038
00039
00040 }
00041 }
00042 }
00043
00044 }