Exemplo n.º 1
0
  // writes the passed string to the passed file
  private void setContents(File file, String content) {
    try {
      BufferedWriter output = new BufferedWriter(new FileWriter(file));

      output.write(content);
      output.close();
    } catch (Exception e) {
      System.out.println("Encryption/Decryption File Error: " + e);
    }
  }
Exemplo n.º 2
0
    private void output(String string) throws Exception {
      if (bw != null) bw.write(string);
      else append(string);

      // Set the fraction done.
      long pct = (filePosition * 100) / fileLength;
      if (pct != percentDone) {
        percentDone = pct;
        setMessage("Working... (" + pct + "%)");
      }
    }