private void writeResults(int[] dist, SortedVector<AllMatches> avgmatches, SortedVector<AllMatches> maxmatches, SortedVector<AllMatches> minmatches, Cluster clustering) throws jplag.ExitException { options.setState(Options.GENERATING_RESULT_FILES); options.setProgress(0); if (options.original_dir == null) print("Writing results to: " + options.result_dir + "\n", null); File f = new File(options.result_dir); if (!f.exists()) if (!f.mkdirs()) { throw new jplag.ExitException("Cannot create directory!"); } if (!f.isDirectory()) { throw new jplag.ExitException(options.result_dir + " is not a directory!"); } if (!f.canWrite()) { throw new jplag.ExitException("Cannot write directory: " + options.result_dir); } this.report.write(f, dist, avgmatches, maxmatches, minmatches, clustering, options); if (options.externalSearch) writeTextResult(f, avgmatches); }