private FileStorage getFileStorage(int chunkId) { String chunkFileName = btreeStoragePath + File.separator + chunkId + AOStorage.SUFFIX_AO_FILE; FileStorage fileStorage = new FileStorage(); fileStorage.open(chunkFileName, map.config); return fileStorage; }
/** * Open an encrypted file store with the given settings. * * @param handler the data handler * @param name the file name * @param mode the access mode (r, rw, rws, rwd) * @param cipher the name of the cipher algorithm * @param key the encryption key * @param keyIterations the number of iterations the key should be hashed * @return the created object */ public static FileStorage open(DataHandler handler, String name, String mode, String cipher, byte[] key, int keyIterations) { FileStorage store; if (cipher == null) { store = new FileStorage(handler, name, mode); } else { store = new SecureFileStorage(handler, name, mode, cipher, key, keyIterations); } return store; }
RedoLogChunk(int id, Map<String, String> config) { this.id = id; this.config = config; String chunkFileName = getChunkFileName(config, id); fileStorage = new FileStorage(); fileStorage.open(chunkFileName, config); queue = new LinkedTransferQueue<>(); pos = fileStorage.size(); if (pos > 0) read(); }
File file= new File( path ); IWorkbenchPage page = window.getActivePage(); IStorage storage = new FileStorage(file); IStorageEditorInput input = new XMLInput( storage ); try { page.openEditor(input, "Your ID"); } catch (PartInitException e) { MessageDialog.openError(window.getShell(), "", path); }
public static void main(String[] args){ FileStorage fileStorage = new FileStorage(); // User create a new file File file1 = new File(); fileStorage.addNewFile(file1, "file1"); // name can also be file1.getName() [...] // Later you can access the file File storedFile = fileStorage.getStoredFile("file1"); }