Tabnine Logo
FileStorage.init
Code IndexAdd Tabnine to your IDE (free)

How to use
init
method
in
org.lealone.storage.fs.FileStorage

Best Java code snippets using org.lealone.storage.fs.FileStorage.init (Showing top 3 results out of 315)

origin: lealone/Lealone

@Override
public FileStorage openFile(String name, String openMode, boolean mustExist) {
  if (mustExist && !FileUtils.exists(name)) {
    throw DbException.get(ErrorCode.FILE_NOT_FOUND_1, name);
  }
  FileStorage fileStorage = FileStorage.open(this, name, openMode, dbSettings.cipher,
      dbSettings.filePasswordHash);
  try {
    fileStorage.init();
  } catch (DbException e) {
    fileStorage.closeSilently();
    throw e;
  }
  return fileStorage;
}
origin: lealone/Lealone

private void initStore() {
  Database db = session.getDatabase();
  byte[] key = null;
  if (cipher != null && password != null) {
    char[] pass = password.optimize(session).getValue(session).getString().toCharArray();
    key = SHA256.getKeyPasswordHash("script", pass);
  }
  String file = getFileName();
  fileStorage = FileStorage.open(db, file, "rw", cipher, key);
  fileStorage.setCheckedWriting(false);
  fileStorage.init();
}
origin: lealone/Lealone

@Override
public FileStorage openFile(String name, String mode, boolean mustExist) {
  if (mustExist && !FileUtils.exists(name)) {
    throw DbException.get(ErrorCode.FILE_NOT_FOUND_1, name);
  }
  FileStorage fileStorage;
  if (cipher == null) {
    fileStorage = FileStorage.open(this, name, mode);
  } else {
    fileStorage = FileStorage.open(this, name, mode, cipher, fileEncryptionKey, 0);
  }
  fileStorage.setCheckedWriting(false);
  try {
    fileStorage.init();
  } catch (DbException e) {
    fileStorage.closeSilently();
    throw e;
  }
  return fileStorage;
}
org.lealone.storage.fsFileStorageinit

Javadoc

Initialize the file. This method will write or check the file header if required.

Popular methods of FileStorage

  • open
    Open an encrypted file store with the given settings.
  • <init>
    Create a new file using the given settings.
  • closeSilently
    Close the file without throwing any exceptions. Exceptions are simply ignored.
  • readFully
    Read a number of bytes.
  • close
    Close this file.
  • setCheckedWriting
  • autoDelete
    Automatically delete the file once it is no longer in use.
  • getFilePointer
    Get the current location of the file pointer.
  • seek
    Go to the specified file location.
  • sync
    Flush all changes.
  • write
    Write a number of bytes.
  • writeFully
    Write to the file.
  • write,
  • writeFully,
  • addNewFile,
  • checkPowerOff,
  • checkWritingAllowed,
  • closeAndDeleteSilently,
  • closeFile,
  • closeFileSilently,
  • delete

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • compareTo (BigDecimal)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • JPanel (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now