1 33 34 package edu.rice.cs.drjava.config; 35 import java.io.*; 36 import edu.rice.cs.util.FileOps; 37 38 41 public class FileConfiguration extends SavableConfiguration { 42 43 public final File file; 44 45 49 public FileConfiguration(File f) { 50 super(new DefaultOptionMap()); 51 file = f.getAbsoluteFile(); 52 } 53 54 57 public void loadConfiguration() throws IOException { 58 loadConfiguration(new BufferedInputStream(new FileInputStream(file))); 59 } 60 61 62 public void saveConfiguration() throws IOException { 63 saveConfiguration("DrJava configuration file"); 64 } 65 66 69 public void saveConfiguration(final String header) throws IOException { 70 FileOps.saveFile(new FileOps.DefaultFileSaver(file) { 71 public void saveTo(OutputStream os) throws IOException { 72 saveConfiguration(os,header); 73 } 74 public boolean shouldBackup() { 75 return false; 76 } 77 }); 78 } 79 } 80 | Popular Tags |