|
a/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/TavernaExtractor.java |
|
b/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/TavernaExtractor.java |
|
... |
|
... |
267 |
|
267 |
|
268 |
File tavernaFile = null;
|
268 |
File tavernaFile = null;
|
269 |
|
269 |
|
270 |
public void process(boolean remote) throws EditException, OpenDataflowException, InvalidOptionException,
|
270 |
public void process(boolean remote) throws EditException, OpenDataflowException, InvalidOptionException,
|
271 |
InvalidDataflowException, TokenOrderException, ReadInputException, DatabaseConfigurationException,
|
271 |
InvalidDataflowException, TokenOrderException, ReadInputException, DatabaseConfigurationException,
|
272 |
CMException, IOException, DeserializationException, IterationTypeMismatchException {
|
272 |
CMException, IOException, DeserializationException, IterationTypeMismatchException, TavernaExtractorException {
|
273 |
|
273 |
|
274 |
LOGGER.info( "Start Taverna Extractor ...");
|
274 |
LOGGER.info( "Start Taverna Extractor ...");
|
275 |
|
275 |
|
276 |
//setup
|
276 |
//setup
|
277 |
TavernaExtractor.setTavernaHomeLib(TavernaExtractor.getTavernaHome().resolve("lib"));
|
277 |
TavernaExtractor.setTavernaHomeLib(TavernaExtractor.getTavernaHome().resolve("lib"));
|
278 |
TavernaExtractor.setTavernaHomeRepo(TavernaExtractor.getTavernaHome().resolve("repository"));
|
278 |
TavernaExtractor.setTavernaHomeRepo(TavernaExtractor.getTavernaHome().resolve("repository"));
|
279 |
|
279 |
|
|
|
280 |
if(remote)
|
|
|
281 |
validateRemoteDirectories(TavernaExtractor.getTavernaHome(), TavernaExtractor.getTavernaHomeLib(), TavernaExtractor.getTavernaHomeRepo());
|
|
|
282 |
else
|
280 |
//validateDirectories(TavernaExtractor.getTavernaHome(), TavernaExtractor.getTavernaHomeLib(), TavernaExtractor.getTavernaHomeRepo());
|
283 |
validateDirectories(TavernaExtractor.getTavernaHome(), TavernaExtractor.getTavernaHomeLib(), TavernaExtractor.getTavernaHomeRepo());
|
281 |
|
284 |
|
282 |
LOGGER.info( "TavernaHome is set to [" + TavernaExtractor.getTavernaHome() + "].");
|
285 |
LOGGER.info( "TavernaHome is set to [" + TavernaExtractor.getTavernaHome() + "].");
|
283 |
LOGGER.info( "TavernaHomeLib is set to [" + TavernaExtractor.getTavernaHomeLib() + "].");
|
286 |
LOGGER.info( "TavernaHomeLib is set to [" + TavernaExtractor.getTavernaHomeLib() + "].");
|
284 |
LOGGER.info( "TavernaHomeRepo is set to [" + TavernaExtractor.getTavernaHomeRepo() + "].");
|
287 |
LOGGER.info( "TavernaHomeRepo is set to [" + TavernaExtractor.getTavernaHomeRepo() + "].");
|
285 |
LOGGER.info( "Workflow input file is [" + TavernaExtractor.getInputFileName() + "].");
|
288 |
LOGGER.info( "Workflow input file is [" + TavernaExtractor.getInputFileName() + "].");
|
|
... |
|
... |
1910 |
}
|
1913 |
}
|
1911 |
}
|
1914 |
}
|
1912 |
}
|
1915 |
}
|
1913 |
}
|
1916 |
}
|
1914 |
|
1917 |
|
1915 |
// TODO valdiate dirs of remote machine
|
|
|
1916 |
private void validateDirectories(Path... dirs) throws IOException{
|
1918 |
private void validateDirectories(Path... dirs) throws TavernaExtractorException{
|
1917 |
|
1919 |
|
1918 |
for(Path path : dirs) {
|
1920 |
for(Path path : dirs) {
|
1919 |
if (path == null || Files.notExists(path) || !Files.isDirectory(path) || !Files.isReadable(path)) {
|
1921 |
if (path == null || Files.notExists(path) || !Files.isDirectory(path) || !Files.isReadable(path)) {
|
1920 |
throw new IOException("Directory '" + path + "' does not exists or is invalid.");
|
1922 |
throw new TavernaExtractorException("Directory '" + path + "' does not exists or is invalid.");
|
|
|
1923 |
}
|
1921 |
}
|
1924 |
}
|
|
|
1925 |
}
|
|
|
1926 |
|
|
|
1927 |
private void validateRemoteDirectories(Path... dirs) throws TavernaExtractorException{
|
|
|
1928 |
try {
|
|
|
1929 |
for(Path path : dirs)
|
|
|
1930 |
sshManager.directoryExists(sshManager.createSession(15000), path);
|
|
|
1931 |
}
|
|
|
1932 |
catch(SSHManagerException sshME){
|
|
|
1933 |
throw new TavernaExtractorException(sshME.getLocalizedMessage());
|
1922 |
}
|
1934 |
}
|
1923 |
}
|
1935 |
}
|
1924 |
|
1936 |
|
1925 |
private List<String> cleanedClasspath(List<String> classpathEntries){
|
1937 |
private List<String> cleanedClasspath(List<String> classpathEntries){
|
1926 |
|
1938 |
|