/** * Returns a <code>ManagedOutputStream</code> for a managed file. * Closing the ouput stream will update the storage manager with the * new content of the managed file. * * @param managedFile the name of the managed file to write. * @return a managed output stream for the managed file. * @throws IOException if an error occurs opening the managed file. */ public ManagedOutputStream getOutputStream(String managedFile) throws IOException { if (useReliableFiles) { ReliableFileOutputStream out = new ReliableFileOutputStream(new File(getBase(), managedFile)); return new ManagedOutputStream(out, this, managedFile, null); } File tmpFile = createTempFile(managedFile); return new ManagedOutputStream(new FileOutputStream(tmpFile), this, managedFile, tmpFile); }
/** * Returns a <code>ManagedOutputStream</code> for a managed file. * Closing the ouput stream will update the storage manager with the * new content of the managed file. * * @param managedFile the name of the managed file to write. * @return a managed output stream for the managed file. * @throws IOException if an error occurs opening the managed file. */ public ManagedOutputStream getOutputStream(String managedFile) throws IOException { if (useReliableFiles) { ReliableFileOutputStream out = new ReliableFileOutputStream(new File(getBase(), managedFile)); return new ManagedOutputStream(out, this, managedFile, null); } File tmpFile = createTempFile(managedFile); return new ManagedOutputStream(new FileOutputStream(tmpFile), this, managedFile, tmpFile); }
/** * Returns a <code>ManagedOutputStream</code> for a managed file. * Closing the ouput stream will update the storage manager with the * new content of the managed file. * * @param managedFile the name of the managed file to write. * @return a managed output stream for the managed file. * @throws IOException if an error occurs opening the managed file. */ public ManagedOutputStream getOutputStream(String managedFile) throws IOException { if (useReliableFiles) { ReliableFileOutputStream out = new ReliableFileOutputStream(new File(getBase(), managedFile)); return new ManagedOutputStream(out, this, managedFile, null); } File tmpFile = createTempFile(managedFile); return new ManagedOutputStream(new FileOutputStream(tmpFile), this, managedFile, tmpFile); }
/** * Returns a <code>ManagedOutputStream</code> for a managed file. * Closing the ouput stream will update the storage manager with the * new content of the managed file. * * @param managedFile the name of the managed file to write. * @return a managed output stream for the managed file. * @throws IOException if an error occurs opening the managed file. */ public ManagedOutputStream getOutputStream(String managedFile) throws IOException { if (useReliableFiles) { ReliableFileOutputStream out = new ReliableFileOutputStream(new File(getBase(), managedFile)); return new ManagedOutputStream(out, this, managedFile, null); } File tmpFile = createTempFile(managedFile); return new ManagedOutputStream(new FileOutputStream(tmpFile), this, managedFile, tmpFile); }
/** * Returns a <code>ManagedOutputStream</code> for a managed file. * Closing the ouput stream will update the storage manager with the * new content of the managed file. * * @param managedFile the name of the managed file to write. * @return a managed output stream for the managed file. * @throws IOException if an error occurs opening the managed file. */ public ManagedOutputStream getOutputStream(String managedFile) throws IOException { if (useReliableFiles) { ReliableFileOutputStream out = new ReliableFileOutputStream(new File(getBase(), managedFile)); return new ManagedOutputStream(out, this, managedFile, null); } File tmpFile = createTempFile(managedFile); return new ManagedOutputStream(new FileOutputStream(tmpFile), this, managedFile, tmpFile); }
/** * Returns a <code>ManagedOutputStream</code> for a managed file. * Closing the ouput stream will update the storage manager with the * new content of the managed file. * * @param managedFile the name of the managed file to write. * @return a managed output stream for the managed file. * @throws IOException if an error occurs opening the managed file. */ public ManagedOutputStream getOutputStream(String managedFile) throws IOException { if (useReliableFiles) { ReliableFileOutputStream out = new ReliableFileOutputStream(new File(getBase(), managedFile)); return new ManagedOutputStream(out, this, managedFile, null); } File tmpFile = createTempFile(managedFile); return new ManagedOutputStream(new FileOutputStream(tmpFile), this, managedFile, tmpFile); }
/** * Returns a <code>ManagedOutputStream</code> for a managed file. * Closing the ouput stream will update the storage manager with the * new content of the managed file. * * @param managedFile the name of the managed file to write. * @return a managed output stream for the managed file. * @throws IOException if an error occurs opening the managed file. */ public ManagedOutputStream getOutputStream(String managedFile) throws IOException { if (useReliableFiles) { ReliableFileOutputStream out = new ReliableFileOutputStream(new File(getBase(), managedFile)); return new ManagedOutputStream(out, this, managedFile, null); } File tmpFile = createTempFile(managedFile); return new ManagedOutputStream(new FileOutputStream(tmpFile), this, managedFile, tmpFile); }
/** * Returns a <code>ManagedOutputStream</code> for a managed file. * Closing the ouput stream will update the storage manager with the * new content of the managed file. * * @param managedFile the name of the managed file to write. * @return a managed output stream for the managed file. * @throws IOException if an error occurs opening the managed file. */ public ManagedOutputStream getOutputStream(String managedFile) throws IOException { if (useReliableFiles) { ReliableFileOutputStream out = new ReliableFileOutputStream(new File(getBase(), managedFile)); return new ManagedOutputStream(out, this, managedFile, null); } File tmpFile = createTempFile(managedFile); return new ManagedOutputStream(new FileOutputStream(tmpFile), this, managedFile, tmpFile); }
private synchronized static void saveData(String fileName) { if (storageManager == null || storageManager.isReadOnly()) return; try { File data = storageManager.createTempFile(fileName); if (FILE_APPLOCKS.equals(fileName)) saveLocks(data); else if (FILE_APPSCHEDULED.equals(fileName)) saveSchedules(data); storageManager.lookup(fileName, true); storageManager.update(new String[] {fileName}, new String[] {data.getName()}); } catch (IOException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, NLS.bind(Messages.persistence_error_saving, fileName), 0, e, null)); } }
private synchronized static void saveData(String fileName) { if (storageManager == null || storageManager.isReadOnly()) return; try { File data = storageManager.createTempFile(fileName); if (FILE_APPLOCKS.equals(fileName)) saveLocks(data); else if (FILE_APPSCHEDULED.equals(fileName)) saveSchedules(data); storageManager.lookup(fileName, true); storageManager.update(new String[] {fileName}, new String[] {data.getName()}); } catch (IOException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, NLS.bind(Messages.persistence_error_saving, fileName), 0, e, null)); } }
private synchronized static void saveData(String fileName) { if (storageManager == null || storageManager.isReadOnly()) return; try { File data = storageManager.createTempFile(fileName); if (FILE_APPLOCKS.equals(fileName)) saveLocks(data); else if (FILE_APPSCHEDULED.equals(fileName)) saveSchedules(data); storageManager.lookup(fileName, true); storageManager.update(new String[] {fileName}, new String[] {data.getName()}); } catch (IOException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, NLS.bind(Messages.persistence_error_saving, fileName), 0, e, null)); } }