Skip to content

Commit

Permalink
Remove redundant data from ARX project files
Browse files Browse the repository at this point in the history
  • Loading branch information
prasser committed Sep 12, 2017
1 parent 1b94aad commit 3bd1ee6
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 55 deletions.
Binary file modified data/example.deid
Binary file not shown.
Binary file modified data/example2.deid
Binary file not shown.
Binary file modified data/example3.deid
Binary file not shown.
Binary file modified data/example4.deid
Binary file not shown.
56 changes: 1 addition & 55 deletions src/gui/org/deidentifier/arx/gui/worker/WorkerSave.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public WorkerSave(final String path,
public void run(final IProgressMonitor arg0) throws InvocationTargetException,
InterruptedException {

arg0.beginTask(Resources.getMessage("WorkerSave.0"), 10); //$NON-NLS-1$
arg0.beginTask(Resources.getMessage("WorkerSave.0"), 8); //$NON-NLS-1$

try {
final FileOutputStream f = new FileOutputStream(path);
Expand All @@ -103,11 +103,6 @@ public void run(final IProgressMonitor arg0) throws InvocationTargetException,
arg0.worked(1);
writeInput(model, zip);
arg0.worked(1);
writeInputSubset(model, zip);
arg0.worked(1);
writeOutput(model, zip);
arg0.worked(1);
writeOutputSubset(model, zip);
arg0.worked(1);
writeConfiguration(model, zip);
arg0.worked(1);
Expand All @@ -124,7 +119,6 @@ public void run(final IProgressMonitor arg0) throws InvocationTargetException,
return;
}

arg0.worked(100);
arg0.done();
}

Expand Down Expand Up @@ -544,24 +538,6 @@ private void writeInput(final Model model, final ZipOutputStream zip) throws IOE
}
}

/**
* Writes the input subset to the file.
*
* @param model
* @param zip
* @throws IOException
*/
private void writeInputSubset(final Model model, final ZipOutputStream zip) throws IOException {
if (model.getInputConfig().getInput() != null) {
if (model.getInputConfig().getInput().getHandle() != null) {
zip.putNextEntry(new ZipEntry("data/input_subset.csv")); //$NON-NLS-1$
final CSVDataOutput out = new CSVDataOutput(zip, model.getCSVSyntax().getDelimiter());
out.write(model.getInputConfig().getInput().getHandle().getView().iterator());
}
}
}


/**
* Writes the lattice to the file.
*
Expand Down Expand Up @@ -666,34 +642,4 @@ private void writeModel(final Model model, final ZipOutputStream zip) throws IOE
w.write(toXML(model));
w.flush();
}

/**
* Writes the output to the file.
*
* @param model
* @param zip
* @throws IOException
*/
private void writeOutput(final Model model, final ZipOutputStream zip) throws IOException {
if (model.getOutput() != null) {
zip.putNextEntry(new ZipEntry("data/output.csv")); //$NON-NLS-1$
final CSVDataOutput out = new CSVDataOutput(zip, model.getCSVSyntax().getDelimiter());
out.write(model.getOutput().iterator());
}
}

/**
* Writes the output to the file.
*
* @param model
* @param zip
* @throws IOException
*/
private void writeOutputSubset(final Model model, final ZipOutputStream zip) throws IOException {
if (model.getOutput() != null) {
zip.putNextEntry(new ZipEntry("data/output_subset.csv")); //$NON-NLS-1$
final CSVDataOutput out = new CSVDataOutput(zip, model.getCSVSyntax().getDelimiter());
out.write(model.getOutput().getView().iterator());
}
}
}

0 comments on commit 3bd1ee6

Please sign in to comment.