From: Sasa M. <sa...@us...> - 2004-10-22 12:31:12
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29236/org/jrobin/core Modified Files: RrdDb.java Log Message: Modifed RrdDb constructor so that it throws more specific FileNotFoundException (subclass of IOException) if the RRD file does not exist. Won't break existing code. Index: RrdDb.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdDb.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** RrdDb.java 21 Oct 2004 08:05:25 -0000 1.32 --- RrdDb.java 22 Oct 2004 12:30:50 -0000 1.33 *************** *** 26,33 **** package org.jrobin.core; ! import java.io.ByteArrayOutputStream; ! import java.io.FileOutputStream; ! import java.io.IOException; ! import java.io.OutputStream; /** --- 26,30 ---- package org.jrobin.core; ! import java.io.*; /** *************** *** 215,227 **** * <code>IOException</code> will be thrown. * @param factory Backend factory which will be used for this RRD. ! * @throws IOException Thrown in case of I/O error. * @throws RrdException Thrown in case of JRobin specific error. * @see RrdBackendFactory */ public RrdDb(String path, boolean readOnly, RrdBackendFactory factory) ! throws IOException, RrdException { // opens existing RRD file - throw exception if the file does not exist... if(!factory.exists(path)) { ! throw new IOException("Could not open " + path + " [non existent]"); } backend = factory.open(path, readOnly, lockMode); --- 212,225 ---- * <code>IOException</code> will be thrown. * @param factory Backend factory which will be used for this RRD. ! * @throws FileNotFoundException Thrown if the requested file does not exist. ! * @throws IOException Thrown in case of general I/O error (bad RRD file, for example). * @throws RrdException Thrown in case of JRobin specific error. * @see RrdBackendFactory */ public RrdDb(String path, boolean readOnly, RrdBackendFactory factory) ! throws FileNotFoundException, IOException, RrdException { // opens existing RRD file - throw exception if the file does not exist... if(!factory.exists(path)) { ! throw new FileNotFoundException("Could not open " + path + " [non existent]"); } backend = factory.open(path, readOnly, lockMode); |