db.close();
}
}
public Bookmark[] getBookmarks() throws IllegalArgumentException, FetchException, OpenIdException {
DbHelper db = null;
Bookmark[] bookmarks = null;
try {
db = new DbHelper(new File(getServletContext().getRealPath("/")), getThreadLocalRequest());
bookmarks = db.getBookmarks();
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new FetchException(e.getMessage(), e);
} catch (FileNotFoundException e) {
e.printStackTrace();
throw new FetchException(e.getMessage(), e);
} catch (JSONException e) {
e.printStackTrace();
throw new FetchException(e.getMessage(), e);
} catch (SQLException e) {
e.printStackTrace();
throw new FetchException(e.getMessage(), e);
} catch (IOException e) {
e.printStackTrace();
throw new FetchException(e.getMessage(), e);
} catch (ParseException e) {
e.printStackTrace();
throw new FetchException(e.getMessage(), e);
} finally {
if (db != null)
db.close();
}
return bookmarks;
}