// prompt user for file for writing
 private void initWrite() {
   File f = FileSelector.saveFile();
   if (f == null) {
     throw new ResourceException("FileResource: no file choosen for writing");
   } else {
     initWrite(f);
   }
 }
 // Prompt user for file to open
 private void initRead() {
   File f = FileSelector.selectFile();
   if (f == null) {
     throw new ResourceException("FileResource: no file choosen for reading");
   } else {
     initRead(f);
   }
 }