Examples of BackupOutputStream


Examples of com.mucommander.io.backup.BackupOutputStream

  private static final Logger LOGGER = LoggerFactory.getLogger(ActionKeymapWriter.class);
 
  ActionKeymapWriter() {}
 
  public void create() throws IOException {
    BackupOutputStream bos = new BackupOutputStream(getActionsFile());

    try {
      new Writer(bos).writeKeyMap(null);
    } catch (Exception e) {
      LOGGER.debug("Caught exception", e);
    } finally {
      bos.close();
    }
  }
View Full Code Here

Examples of com.mucommander.io.backup.BackupOutputStream

      keyStrokes[1] = ActionKeymap.getAlternateAccelerator(actionId);

      combinedMapping.put(actionId, keyStrokes);
    }
   
    BackupOutputStream bos = new BackupOutputStream(getActionsFile());

    try {
      new Writer(bos).writeKeyMap(combinedMapping);
      wereActionsModified = false;
    } catch (Exception e) {
      LOGGER.debug("Caught exception", e);
    } finally {
      bos.close();
    }
  }
View Full Code Here

Examples of com.mucommander.io.backup.BackupOutputStream

        // Write bookmarks file only if changes were made to the bookmarks since last write, or if write is forced.
        if(!(forceWrite || saveNeeded))
            return;
        out = null;
        try {
            buildBookmarks(getBookmarkWriter(out = new BackupOutputStream(getBookmarksFile())));
            saveNeeded = false;
        }
        finally {
            if(out != null) {
                try {out.close();}
View Full Code Here

Examples of com.mucommander.io.backup.BackupOutputStream

    /**
     * Writes the shell history to hard drive.
     * @throws IOException if an I/O error occurs.
     */
    public static void writeHistory() throws IOException {
        BackupOutputStream out;

        out = null;
        try {ShellHistoryWriter.write(out = new BackupOutputStream(getHistoryFile()));}
        finally {
            if(out != null) {
                try {out.close();}
                catch(Exception e) {}
            }
        }
    }
View Full Code Here

Examples of com.mucommander.io.backup.BackupOutputStream

    /**
     * Returns an output stream on the configuration file.
     * @return an output stream on the configuration file.
     */
    public synchronized Writer getWriter() throws IOException {
        return new OutputStreamWriter(new BackupOutputStream(getConfigurationFile()), Charset.forName("utf-8"));
    }
View Full Code Here

Examples of com.mucommander.io.backup.BackupOutputStream

  private ToolBarWriter() {}
 
  void write() throws IOException {
    String[] actionIds = ToolBarAttributes.getActions();
   
    BackupOutputStream bos = new BackupOutputStream(getDescriptionFile());
    try {
      new Writer(bos).write(actionIds);
      wasToolBarModified = false;
    } catch (Exception e) {
      LOGGER.debug("Caught exception", e);
    } finally {
      bos.close();
    }
  }
View Full Code Here

Examples of com.mucommander.io.backup.BackupOutputStream

  void write() throws IOException {
    String[] commandBarActionIds = CommandBarAttributes.getActions();
    String[] commandBarAlterativeActionIds = CommandBarAttributes.getAlternateActions();
    KeyStroke commandBarModifier = CommandBarAttributes.getModifier();

    BackupOutputStream bos = new BackupOutputStream(getDescriptionFile());

    try {
      new Writer(bos).write(commandBarActionIds, commandBarAlterativeActionIds, commandBarModifier);
      wasCommandBarModified = false;
    } catch (Exception e) {
      LOGGER.debug("Caught exception", e);
    } finally {
      bos.close();
    }
  }
View Full Code Here

Examples of com.mucommander.io.backup.BackupOutputStream

     * @see                     #setAssociationFile(String)
     */
    public static void writeAssociations() throws CommandException, IOException {
        // Do not save the associations if they were not modified.
        if(wereAssociationsModified) {
            BackupOutputStream out;    // Where to write the associations.

            LOGGER.debug("Writing associations to file: " + getAssociationFile());

            // Writes the associations.
            out = null;
            try {
                buildAssociations(new AssociationWriter(out = new BackupOutputStream(getAssociationFile())));
                wereAssociationsModified = false;
            }
            finally {
                if(out != null) {
                    try {out.close();}
                    catch(Exception e) {
                        // Ignores this.
                    }
                }
            }
View Full Code Here

Examples of com.mucommander.io.backup.BackupOutputStream

     * @see                     #setCommandFile(String)
     */
    public static void writeCommands() throws IOException, CommandException {
        // Only saves the command if they were modified since the last time they were written.
        if(wereCommandsModified) {
            BackupOutputStream out;    // Where to write the associations.

            LOGGER.debug("Writing custom commands to file: " + getCommandFile());

            // Writes the commands.
            out = null;
            try {
                buildCommands(new CommandWriter(out = new BackupOutputStream(getCommandFile())));
                wereCommandsModified = false;
            }
            finally {
                if(out != null) {
                    try {out.close();}
                    catch(Exception e) {
                        // Ignores this.
                    }
                }
            }
View Full Code Here

Examples of com.mucommander.io.backup.BackupOutputStream

     * @param  name        name of the custom theme on which to open an output stream.
     * @return             an output stream on the specified custom theme.
     * @throws IOException if an I/O related error occurs.
     */
    private static BackupOutputStream getCustomThemeOutputStream(String name) throws IOException {
        return new BackupOutputStream(getCustomThemesFolder().getChild(name + ".xml"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.