source: other-projects/the-macronizer/trunk/src/java/monogram/plugin/PluginTXT.java@ 30062

Last change on this file since 30062 was 30062, checked in by davidb, 9 years ago

Removal/Tidy-up of debug statements

File size: 1.0 KB
Line 
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5package monogram.plugin;
6
7import java.io.File;
8import java.io.IOException;
9import monogram.restorer.TxtRestorer;
10
11/**
12 * @author University of Waikato - Te Whare Wānanga o Waikato
13 * @version 1.0
14 * @since 2014-11-20
15 */
16public class PluginTXT implements Plugin {
17
18 private File tmpdir;
19
20 public PluginTXT(File tmpdir) {
21 this.tmpdir = tmpdir;
22 }
23
24 public File run(PluginConfiguration configuration) throws IllegalArgumentException, IOException {
25 if (configuration.getCharsetEncoding() == null) {
26
27 throw new IllegalArgumentException();
28 }
29 final File outputFile = File.createTempFile("mi-tmp-", configuration.getFileType(), tmpdir);
30 final TxtRestorer restorer = new TxtRestorer();
31 restorer.restore(configuration.getFile(), configuration.getCharsetEncoding(), outputFile, configuration.getPreserveExistingMacrons());
32 return outputFile;
33 }
34}
Note: See TracBrowser for help on using the repository browser.