示例#1
0
  /**
   * Saves an OLS data file to the given file.
   *
   * @param aFile the file to save the OLS data to, cannot be <code>null</code>.
   * @throws IOException in case of I/O problems.
   */
  public void saveDataFile(final File aFile) throws IOException {
    final FileWriter writer = new FileWriter(aFile);
    try {
      final Project tempProject = this.projectManager.createTemporaryProject();
      tempProject.setCapturedData(this.dataContainer);

      OlsDataHelper.write(tempProject, writer);
    } finally {
      writer.flush();
      writer.close();
    }
  }
示例#2
0
 public boolean compile(String sol) throws ServerException {
   try {
     createSrcFile();
     File f = new File(workDir, srcFileName);
     FileWriter fw = new FileWriter(f);
     fw.write(sol);
     fw.close();
     exec(compileCmd, "", 2, 2048);
     File ef = new File(workDir, executableName);
     return ef.exists();
   } catch (Exception e) {
     throw UtilSrv.se("Can't compile.", e);
   }
 }
示例#3
0
 private void save(String data, File f) throws IOException {
   FileWriter fw = new FileWriter(f);
   fw.write(data);
   fw.close();
 }