From: <bra...@us...> - 2010-04-02 02:53:50
|
Revision: 3009 http://archive-access.svn.sourceforge.net/archive-access/?rev=3009&view=rev Author: bradtofel Date: 2010-04-02 02:53:44 +0000 (Fri, 02 Apr 2010) Log Message: ----------- TWEAK: changed DatabaseException to IOException on initialization failure of BDBRecordSet and callers Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourceindex/bdb/BDBIndex.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourcestore/locationdb/BDBResourceFileLocationDB.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/bdb/BDBRecordSet.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourceindex/bdb/BDBIndex.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourceindex/bdb/BDBIndex.java 2010-03-30 22:34:57 UTC (rev 3008) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourceindex/bdb/BDBIndex.java 2010-04-02 02:53:44 UTC (rev 3009) @@ -62,7 +62,7 @@ * @throws DatabaseException * @throws ConfigurationException */ - public void init() throws DatabaseException, ConfigurationException { + public void init() throws IOException, ConfigurationException { initializeDB(bdbPath,bdbName); } @@ -151,7 +151,7 @@ UrlCanonicalizer canonicalizer = new AggressiveUrlCanonicalizer(); try { index.initializeDB(path,name); - } catch (DatabaseException e) { + } catch (IOException e) { e.printStackTrace(); System.exit(1); } Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourcestore/locationdb/BDBResourceFileLocationDB.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourcestore/locationdb/BDBResourceFileLocationDB.java 2010-03-30 22:34:57 UTC (rev 3008) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/resourcestore/locationdb/BDBResourceFileLocationDB.java 2010-04-02 02:53:44 UTC (rev 3009) @@ -87,11 +87,7 @@ public void init() throws IOException { bdb = new BDBRecordSet(); - try { - bdb.initializeDB(bdbPath,bdbName); - } catch (DatabaseException e) { - throw wrapDBException(e); - } + bdb.initializeDB(bdbPath,bdbName); if(logPath == null) { throw new IOException("No logPath"); } Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/bdb/BDBRecordSet.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/bdb/BDBRecordSet.java 2010-03-30 22:34:57 UTC (rev 3008) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/bdb/BDBRecordSet.java 2010-04-02 02:53:44 UTC (rev 3009) @@ -25,6 +25,7 @@ package org.archive.wayback.util.bdb; import java.io.File; +import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.Iterator; @@ -74,10 +75,10 @@ /** * @param thePath Directory where BDBJE files are stored * @param theDbName Name of files in thePath - * @throws DatabaseException + * @throws IOException for usual reasons, plus as database exceptions */ public void initializeDB(final String thePath, final String theDbName) - throws DatabaseException { + throws IOException { path = thePath; dbName = theDbName; @@ -88,7 +89,7 @@ File file = new File(path); if(!file.isDirectory()) { if(!file.mkdirs()) { - throw new DatabaseException("failed mkdirs(" + path + ")"); + throw new IOException("failed mkdirs(" + path + ")"); } } env = new Environment(file, environmentConfig); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |