Switch to unified view

a/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/TavernaExtractor.java b/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/TavernaExtractor.java
...
...
78
import javax.xml.xpath.*;
78
import javax.xml.xpath.*;
79
import java.awt.*;
79
import java.awt.*;
80
import java.io.*;
80
import java.io.*;
81
import java.net.MalformedURLException;
81
import java.net.MalformedURLException;
82
import java.net.URL;
82
import java.net.URL;
83
import java.nio.charset.StandardCharsets;
83
import java.nio.file.*;
84
import java.nio.file.*;
84
import java.nio.file.attribute.BasicFileAttributes;
85
import java.nio.file.attribute.BasicFileAttributes;
85
import java.util.*;
86
import java.util.*;
86
import java.util.List;
87
import java.util.List;
87
import java.util.Map.Entry;
88
import java.util.Map.Entry;
...
...
177
178
178
    private Dataflow dataflow;
179
    private Dataflow dataflow;
179
    private SSHManager sshManager;
180
    private SSHManager sshManager;
180
    private static Logger LOGGER = LogManager.getLogger("TavernaExtractor");
181
    private static Logger LOGGER = LogManager.getLogger("TavernaExtractor");
181
182
183
    private String convertedFileAsString = null;
184
182
    public TavernaExtractor(){
185
    public TavernaExtractor(){
183
        LOGGER.setLevel(Level.INFO);
186
        LOGGER.setLevel(Level.INFO);
184
    }
187
    }
185
188
186
    public TavernaExtractor(boolean verbose) {
189
    public TavernaExtractor(boolean verbose) {
...
...
2251
        }
2254
        }
2252
        catch(SSHManagerException e){
2255
        catch(SSHManagerException e){
2253
            e.printStackTrace();
2256
            e.printStackTrace();
2254
        }
2257
        }
2255
2258
2259
        //for the testbed, return file content as string representation
2260
        convertedFileAsString = new String(Files.readAllBytes(outputTmp), StandardCharsets.UTF_8);
2261
2256
        // remove both temp files.
2262
        // remove both temp files.
2257
        Files.deleteIfExists(outputTmp);
2263
        Files.deleteIfExists(outputTmp);
2258
        Files.deleteIfExists(tavernaFile.toPath());
2264
        Files.deleteIfExists(tavernaFile.toPath());
2259
    }
2265
    }
2260
2266
...
...
2273
        resource.getContents().add(model);
2279
        resource.getContents().add(model);
2274
        resource.save(null);
2280
        resource.save(null);
2275
2281
2276
        LOGGER.info("Wrote model successfully to " + outFile.getAbsolutePath());
2282
        LOGGER.info("Wrote model successfully to " + outFile.getAbsolutePath());
2277
    }
2283
    }
2284
2285
2286
    public String getConvertedFileAsString() throws TavernaExtractorException{
2287
        if(convertedFileAsString != null)
2288
            return convertedFileAsString;
2289
        throw new TavernaExtractorException("Can not read file content");
2290
    }
2278
}
2291
}