private static void closeSilently(FileStore fileStore) { if (fileStore != null) { fileStore.closeSilently(); } }
/** * Close the file (ignoring exceptions) and delete the file. */ public void closeAndDeleteSilently() { if (file != null) { closeSilently(); handler.getTempFileDeleter().deleteFile(autoDeleteReference, name); name = null; } }
/** * Close input and output streams. */ void closeIO() { IOUtils.closeSilently(out); out = null; IOUtils.closeSilently(in); in = null; if (store != null) { store.closeSilently(); store = null; } }
@Override public FileStore openFile(String name, String openMode, boolean mustExist) { if (mustExist && !FileUtils.exists(name)) { throw DbException.get(ErrorCode.FILE_NOT_FOUND_1, name); } FileStore store = FileStore.open(this, name, openMode, cipher, filePasswordHash); try { store.init(); } catch (DbException e) { store.closeSilently(); throw e; } return store; }
private void process(String fileName, boolean quiet) { if (fileName.endsWith(Constants.SUFFIX_MV_FILE)) { try { copy(fileName, quiet); } catch (IOException e) { throw DbException.convertIOException(e, "Error encrypting / decrypting file " + fileName); } return; } FileStore in; if (decrypt == null) { in = FileStore.open(null, fileName, "r"); } else { in = FileStore.open(null, fileName, "r", cipherType, decrypt); } try { in.init(); copy(fileName, in, encrypt, quiet); } finally { in.closeSilently(); } }
@Override public FileStore openFile(String name, String mode, boolean mustExist) { if (mustExist && !FileUtils.exists(name)) { throw DbException.get(ErrorCode.FILE_NOT_FOUND_1, name); } FileStore store; if (cipher == null) { store = FileStore.open(this, name, mode); } else { store = FileStore.open(this, name, mode, cipher, fileEncryptionKey, 0); } store.setCheckedWriting(false); try { store.init(); } catch (DbException e) { store.closeSilently(); throw e; } return store; }
private void closeSilently(FileStore store) { if (store != null) { store.closeSilently(); store = null; } }
private static void closeSilently(FileStore fileStore) { if (fileStore != null) { fileStore.closeSilently(); } }
private static void closeSilently(FileStore fileStore) { if (fileStore != null) { fileStore.closeSilently(); } }
public void closeAndDeleteSilently() { if (file != null) { closeSilently(); TempFileDeleter.deleteFile(autoDeleteReference, name); name = null; } }
/** * Close the file (ignoring exceptions) and delete the file. */ public void closeAndDeleteSilently() { if (file != null) { closeSilently(); handler.getTempFileDeleter().deleteFile(autoDeleteReference, name); name = null; } }
/** * Close the file (ignoring exceptions) and delete the file. */ public void closeAndDeleteSilently() { if (file != null) { closeSilently(); handler.getTempFileDeleter().deleteFile(autoDeleteReference, name); name = null; } }
protected void closeIO() { IOUtils.closeSilently(out); out = null; IOUtils.closeSilently(in); in = null; if (store != null) { store.closeSilently(); store = null; } }
/** * Close input and output streams. */ void closeIO() { IOUtils.closeSilently(out); out = null; IOUtils.closeSilently(in); in = null; if (store != null) { store.closeSilently(); store = null; } }
/** * Close input and output streams. */ void closeIO() { IOUtils.closeSilently(out); out = null; IOUtils.closeSilently(in); in = null; if (store != null) { store.closeSilently(); store = null; } }
@Override public FileStore openFile(String name, String openMode, boolean mustExist) { if (mustExist && !FileUtils.exists(name)) { throw DbException.get(ErrorCode.FILE_NOT_FOUND_1, name); } FileStore store = FileStore.open(this, name, openMode, cipher, filePasswordHash); try { store.init(); } catch (DbException e) { store.closeSilently(); throw e; } return store; }
@Override public FileStore openFile(String name, String openMode, boolean mustExist) { if (mustExist && !FileUtils.exists(name)) { throw DbException.get(ErrorCode.FILE_NOT_FOUND_1, name); } FileStore store = FileStore.open(this, name, openMode, cipher, filePasswordHash); try { store.init(); } catch (DbException e) { store.closeSilently(); throw e; } return store; }
public FileStore openFile(String name, String mode, boolean mustExist) throws SQLException { if (mustExist && !FileUtils.exists(name)) { throw Message.getSQLException(ErrorCode.FILE_NOT_FOUND_1, name); } FileStore store = FileStore.open(this, name, mode, getMagic(), cipher, filePasswordHash); try { store.init(); } catch (SQLException e) { store.closeSilently(); throw e; } return store; }
public FileStore openFile(String name, String mode, boolean mustExist) throws SQLException { if (mustExist && !FileUtils.exists(name)) { throw Message.getSQLException(ErrorCode.FILE_CORRUPTED_1, name); } FileStore store; byte[] magic = Constants.MAGIC_FILE_HEADER.getBytes(); if (cipher == null) { store = FileStore.open(this, name, mode, magic); } else { store = FileStore.open(this, name, mode, magic, cipher, fileEncryptionKey, 0); } store.setCheckedWriting(false); try { store.init(); } catch (SQLException e) { store.closeSilently(); throw e; } return store; }
@Override public FileStore openFile(String name, String mode, boolean mustExist) { if (mustExist && !FileUtils.exists(name)) { throw DbException.get(ErrorCode.FILE_NOT_FOUND_1, name); } FileStore store; if (cipher == null) { store = FileStore.open(this, name, mode); } else { store = FileStore.open(this, name, mode, cipher, fileEncryptionKey, 0); } store.setCheckedWriting(false); try { store.init(); } catch (DbException e) { store.closeSilently(); throw e; } return store; }