public boolean tableIsExist() throws DbException { if (this.isCheckedDatabase()) { return true; } Cursor cursor = db.execQuery( "SELECT COUNT(*) AS c FROM sqlite_master WHERE type='table' AND name='" + tableName + "'"); if (cursor != null) { try { if (cursor.moveToNext()) { int count = cursor.getInt(0); if (count > 0) { this.setCheckedDatabase(true); return true; } } } catch (Throwable e) { throw new DbException(e); } finally { IOUtil.closeQuietly(cursor); } } return false; }
@Override protected void cancelWorks() { if (requestWorker != null && params.isCancelFast()) { requestWorker.interrupt(); } IOUtil.closeQuietly(request); }
@Override protected void onFinished() { if (tracker != null) { tracker.onFinished(request); } clearRawResult(); IOUtil.closeQuietly(request); callback.onFinished(); }
@Override public void close() throws IOException { if (inputStream != null) { IOUtil.closeQuietly(inputStream); } if (connection != null) { connection.disconnect(); } }
private void clearRawResult() { if (rawResult instanceof Closeable) { IOUtil.closeQuietly((Closeable) rawResult); } rawResult = null; }