Update of /cvsroot/jrobin/src/org/jrobin/inspector In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32526/org/jrobin/inspector Modified Files: ArchiveTableModel.java DataTableModel.java DatasourceTableModel.java HeaderTableModel.java MainTreeModel.java RrdInspector.java Log Message: Serious bug fixed (related to strange exceptions when a RRD file is about to be open). RRD file is now open in the read-only mode. Index: DataTableModel.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/DataTableModel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DataTableModel.java 4 Dec 2003 13:21:03 -0000 1.5 --- DataTableModel.java 18 Aug 2004 12:51:26 -0000 1.6 *************** *** 76,80 **** if(dsIndex >= 0 && arcIndex >= 0) { try { ! RrdDb rrd = new RrdDb(file.getAbsolutePath()); Archive arc = rrd.getArchive(arcIndex); Robin robin = arc.getRobin(dsIndex); --- 76,80 ---- if(dsIndex >= 0 && arcIndex >= 0) { try { ! RrdDb rrd = new RrdDb(file.getAbsolutePath(), true); Archive arc = rrd.getArchive(arcIndex); Robin robin = arc.getRobin(dsIndex); Index: MainTreeModel.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/MainTreeModel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MainTreeModel.java 4 Dec 2003 13:21:03 -0000 1.5 --- MainTreeModel.java 18 Aug 2004 12:51:27 -0000 1.6 *************** *** 47,51 **** try { file = newFile; ! RrdDb rrd = new RrdDb(file.getAbsolutePath()); DefaultMutableTreeNode root = new DefaultMutableTreeNode(new RrdNode(rrd)); int dsCount = rrd.getRrdDef().getDsCount(); --- 47,51 ---- try { file = newFile; ! RrdDb rrd = new RrdDb(file.getAbsolutePath(), true); DefaultMutableTreeNode root = new DefaultMutableTreeNode(new RrdNode(rrd)); int dsCount = rrd.getRrdDef().getDsCount(); Index: DatasourceTableModel.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/DatasourceTableModel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DatasourceTableModel.java 4 Dec 2003 13:21:03 -0000 1.5 --- DatasourceTableModel.java 18 Aug 2004 12:51:26 -0000 1.6 *************** *** 80,84 **** if(dsIndex >= 0) { try { ! RrdDb rrd = new RrdDb(file.getAbsolutePath()); Datasource ds = rrd.getDatasource(dsIndex); values = new Object[]{ --- 80,84 ---- if(dsIndex >= 0) { try { ! RrdDb rrd = new RrdDb(file.getAbsolutePath(), true); Datasource ds = rrd.getDatasource(dsIndex); values = new Object[]{ Index: HeaderTableModel.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/HeaderTableModel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** HeaderTableModel.java 20 May 2004 10:29:33 -0000 1.6 --- HeaderTableModel.java 18 Aug 2004 12:51:26 -0000 1.7 *************** *** 73,77 **** values = null; String path = file.getAbsolutePath(); ! RrdDb rrd = new RrdDb(path); Header header = rrd.getHeader(); String signature = header.getSignature(); --- 73,77 ---- values = null; String path = file.getAbsolutePath(); ! RrdDb rrd = new RrdDb(path, true); Header header = rrd.getHeader(); String signature = header.getSignature(); Index: RrdInspector.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/RrdInspector.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RrdInspector.java 13 Jul 2004 10:40:34 -0000 1.6 --- RrdInspector.java 18 Aug 2004 12:51:27 -0000 1.7 *************** *** 250,260 **** JFileChooser chooser = new JFileChooser(lastDirectory); FileFilter filter = new FileFilter() { ! public boolean accept(File f) { ! return f.isDirectory() ? true : ! f.getAbsolutePath().toLowerCase().endsWith(".rrd"); } - public String getDescription() { ! return "JRobin RRD files"; } }; --- 250,260 ---- JFileChooser chooser = new JFileChooser(lastDirectory); FileFilter filter = new FileFilter() { ! public boolean accept(File file) { ! String path = file.getAbsolutePath().toLowerCase(); ! return file.isDirectory() || path.endsWith(".rrd") || ! path.endsWith(".jrb") || path.endsWith(".jrobin"); } public String getDescription() { ! return "JRobin RRD files (*.rrd;*.jrb;*.jrobin)"; } }; *************** *** 263,270 **** if (returnVal == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); ! lastDirectory = file.getParent(); ! //inspectorModel.setFile(file); ! //tabbedPane.setSelectedIndex(0); ! loadFile(file); } } --- 263,272 ---- if (returnVal == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); ! if(file != null) { ! lastDirectory = file.getParent(); ! //inspectorModel.setFile(file); ! //tabbedPane.setSelectedIndex(0); ! loadFile(file); ! } } } *************** *** 333,337 **** try { String sourcePath = inspectorModel.getFile().getCanonicalPath(); ! RrdDb rrd = new RrdDb(sourcePath); DsDef dsDef = rrd.getRrdDef().getDsDefs()[dsIndex]; rrd.close(); --- 335,339 ---- try { String sourcePath = inspectorModel.getFile().getCanonicalPath(); ! RrdDb rrd = new RrdDb(sourcePath, true); DsDef dsDef = rrd.getRrdDef().getDsDefs()[dsIndex]; rrd.close(); *************** *** 368,372 **** try { String sourcePath = inspectorModel.getFile().getCanonicalPath(); ! RrdDb rrd = new RrdDb(sourcePath); ArcDef arcDef = rrd.getRrdDef().getArcDefs()[arcIndex]; rrd.close(); --- 370,374 ---- try { String sourcePath = inspectorModel.getFile().getCanonicalPath(); ! RrdDb rrd = new RrdDb(sourcePath, true); ArcDef arcDef = rrd.getRrdDef().getArcDefs()[arcIndex]; rrd.close(); *************** *** 405,409 **** try { String sourcePath = inspectorModel.getFile().getCanonicalPath(); ! RrdDb rrd = new RrdDb(sourcePath); String dsName = rrd.getRrdDef().getDsDefs()[dsIndex].getDsName(); rrd.close(); --- 407,411 ---- try { String sourcePath = inspectorModel.getFile().getCanonicalPath(); ! RrdDb rrd = new RrdDb(sourcePath, true); String dsName = rrd.getRrdDef().getDsDefs()[dsIndex].getDsName(); rrd.close(); *************** *** 432,436 **** try { String sourcePath = inspectorModel.getFile().getCanonicalPath(); ! RrdDb rrd = new RrdDb(sourcePath); ArcDef arcDef = rrd.getRrdDef().getArcDefs()[arcIndex]; String consolFun = arcDef.getConsolFun(); --- 434,438 ---- try { String sourcePath = inspectorModel.getFile().getCanonicalPath(); ! RrdDb rrd = new RrdDb(sourcePath, true); ArcDef arcDef = rrd.getRrdDef().getArcDefs()[arcIndex]; String consolFun = arcDef.getConsolFun(); Index: ArchiveTableModel.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/ArchiveTableModel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ArchiveTableModel.java 4 Dec 2003 13:21:03 -0000 1.5 --- ArchiveTableModel.java 18 Aug 2004 12:51:26 -0000 1.6 *************** *** 82,86 **** if(dsIndex >= 0 && arcIndex >= 0) { try { ! RrdDb rrd = new RrdDb(file.getAbsolutePath()); Archive arc = rrd.getArchive(arcIndex); ArcState state = arc.getArcState(dsIndex); --- 82,86 ---- if(dsIndex >= 0 && arcIndex >= 0) { try { ! RrdDb rrd = new RrdDb(file.getAbsolutePath(), true); Archive arc = rrd.getArchive(arcIndex); ArcState state = arc.getArcState(dsIndex); |