JWS-17: fix problem with undefined URL for the furtherDetails tag
[jabaws.git] / runner / compbio / runner / Util.java
index a0123a2..f8d7b80 100644 (file)
@@ -52,12 +52,9 @@ public final class Util {
                try {\r
                        return ConfExecutable.getRunnerOptions(clazz);\r
                } catch (FileNotFoundException e) {\r
-                       log.error(\r
-                                       "Could not load " + clazz + " Parameters !"\r
-                                                       + e.getMessage(), e.getCause());\r
+                       log.error("Could not load " + clazz + " parameters !" + e.getMessage(), e.getCause());\r
                } catch (IOException e) {\r
-                       log.error("IO exception while reading " + clazz + " Parameters !"\r
-                                       + e.getMessage(), e.getCause());\r
+                       log.error("IO exception while reading " + clazz + " parameters !" + e.getMessage(), e.getCause());\r
                }\r
                return null;\r
        }\r
@@ -67,28 +64,21 @@ public final class Util {
                try {\r
                        return ConfExecutable.getRunnerPresets(clazz);\r
                } catch (FileNotFoundException e) {\r
-                       log.warn(\r
-                                       "No presets are found for " + clazz + " executable! "\r
-                                                       + e.getLocalizedMessage(), e.getCause());\r
+                       log.warn("No presets are found for " + clazz + "! " + e.getLocalizedMessage(), e.getCause());\r
                } catch (IOException e) {\r
-                       log.warn("IO exception while reading presents! for " + clazz\r
-                                       + " executable! " + e.getLocalizedMessage(), e.getCause());\r
+                       log.warn("IO exception while reading presets for " + clazz + "! " + e.getLocalizedMessage(), e.getCause());\r
                }\r
                return null;\r
        }\r
 \r
-       public static final Alignment readClustalFile(String workDirectory,\r
-                       String clustFile) throws UnknownFileFormatException, IOException,\r
-                       FileNotFoundException, NullPointerException {\r
+       public static final Alignment readClustalFile(String workDirectory, String clustFile) \r
+                               throws UnknownFileFormatException, IOException, FileNotFoundException, NullPointerException {\r
                assert !compbio.util.Util.isEmpty(workDirectory);\r
                assert !compbio.util.Util.isEmpty(clustFile);\r
-               File cfile = new File(compbio.engine.client.Util.getFullPath(\r
-                               workDirectory, clustFile));\r
+               File cfile = new File(compbio.engine.client.Util.getFullPath(workDirectory, clustFile));\r
                log.trace("CLUSTAL OUTPUT FILE PATH: " + cfile.getAbsolutePath());\r
                if (!(cfile.exists() && cfile.length() > 0)) {\r
-                       throw new FileNotFoundException("Result for the jobId "\r
-                                       + workDirectory + " with file name " + clustFile\r
-                                       + " is not found!");\r
+                       throw new FileNotFoundException("Result for the jobId " + workDirectory + " with file name " + clustFile + " is not found!");\r
                }\r
                return ClustalAlignmentUtil.readClustalFile(cfile);\r
        }\r
@@ -102,9 +92,7 @@ public final class Util {
                                workDirectory, clustFile));\r
                log.trace("Jronn OUTPUT FILE PATH: " + cfile.getAbsolutePath());\r
                if (!(cfile.exists() && cfile.length() > 0)) {\r
-                       throw new FileNotFoundException("Result for the jobId "\r
-                                       + workDirectory + " with file name " + clustFile\r
-                                       + " is not found!");\r
+                       throw new FileNotFoundException("Result for the jobId " + workDirectory + " with file name " + clustFile + " is not found!");\r
                }\r
                return SequenceUtil.readJRonn(cfile);\r
        }\r
@@ -118,17 +106,13 @@ public final class Util {
                        SequenceUtil.writeFasta(fout, sequences);\r
                        fout.close();\r
                } catch (IOException e) {\r
-                       log.error("IOException while writing input file into the disk: "\r
-                                       + e.getLocalizedMessage(), e);\r
-                       throw new JobSubmissionException(\r
-                                       "We are sorry by JABAWS server seems to have a problem! "\r
-                                                       + e.getLocalizedMessage(), e);\r
+                       log.error("IOException while writing input file into the disk: " + e.getLocalizedMessage(), e);\r
+                       throw new JobSubmissionException("We are sorry by JABAWS server seems to have a problem! " + e.getLocalizedMessage(), e);\r
                }\r
        }\r
 \r
        public static void writeClustalInput(List<FastaSequence> sequences,\r
                        ConfiguredExecutable<?> exec, char gapChar) throws JobSubmissionException {\r
-               \r
                try {\r
                        File filein = new File(exec.getInput());\r
                        FileOutputStream fout = new FileOutputStream(filein);\r
@@ -136,11 +120,8 @@ public final class Util {
                        SequenceUtil.writeClustal(fout, sequences, gapChar);\r
                        fout.close();\r
                } catch (IOException e) {\r
-                       log.error("IOException while writing input file into the disk: "\r
-                                       + e.getLocalizedMessage(), e);\r
-                       throw new JobSubmissionException(\r
-                                       "We are sorry but JABAWS server seems to have a problem! "\r
-                                               + e.getLocalizedMessage(), e);\r
+                       log.error("IOException while writing input file into the disk: " + e.getLocalizedMessage(), e);\r
+                       throw new JobSubmissionException("We are sorry but JABAWS server seems to have a problem! " + e.getLocalizedMessage(), e);\r
                }\r
        }\r
 \r
@@ -150,16 +131,12 @@ public final class Util {
                assert !compbio.util.Util.isEmpty(workDirectory);\r
                assert !compbio.util.Util.isEmpty(structFile);\r
                // The stdout from RNAalifold\r
-               File sFile = new File(compbio.engine.client.Util.getFullPath(\r
-                               workDirectory, structFile));\r
+               File sFile = new File(compbio.engine.client.Util.getFullPath( workDirectory, structFile));\r
                // Base pair probability matrix (-p option)\r
-               File aliFile = new File(compbio.engine.client.Util.getFullPath(\r
-                               workDirectory, "alifold.out"));\r
+               File aliFile = new File(compbio.engine.client.Util.getFullPath( workDirectory, "alifold.out"));\r
                // Check that stdout file exists\r
                if(!(sFile.exists() && sFile.length() > 0)) {\r
-                       throw new FileNotFoundException("Result for the jobId "\r
-                                       + workDirectory + "with file name " + structFile\r
-                                       + " is not found!");\r
+                       throw new FileNotFoundException("Result for the jobId " + workDirectory + "with file name " + structFile + " is not found!");\r
                }\r
                // Check that base pair probability file exists\r
                if(!aliFile.exists()) {\r