Last change
on this file since 29855 was 29855, checked in by davidb, 9 years ago |
John's code after refactoring by Tom over the summer of 2014/2015
|
File size:
1.2 KB
|
Line | |
---|
1 | /*
|
---|
2 | * To change this template, choose Tools | Templates
|
---|
3 | * and open the template in the editor.
|
---|
4 | */
|
---|
5 | package monogram.plugin;
|
---|
6 |
|
---|
7 | import java.io.File;
|
---|
8 | import java.io.IOException;
|
---|
9 | import 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 | */
|
---|
16 | public 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 | System.out.println("test 5");
|
---|
30 | final File outputFile = File.createTempFile("mi-tmp-", configuration.getFileType(), tmpdir);
|
---|
31 | System.out.println("test 6");
|
---|
32 | final TxtRestorer restorer = new TxtRestorer();
|
---|
33 | System.out.println("test 7");
|
---|
34 | restorer.restore(configuration.getFile(), configuration.getCharsetEncoding(), outputFile, configuration.getPreserveExistingMacrons());
|
---|
35 | System.out.println("test out 2");
|
---|
36 | return outputFile;
|
---|
37 | }
|
---|
38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.