Other necessary changes
[jabaws.git] / webservices / compbio / ws / server / WSUtil.java
index 7341989..e6dd02d 100644 (file)
@@ -159,10 +159,28 @@ public final class WSUtil {
                        }\r
                        if (fs.getLength() != len) {\r
                                throw new JobSubmissionException(\r
-                                               "All sequences must be of the same length. Please align "\r
-                                                               + "the sequences prior to submission! The first sequence length is : "\r
-                                                               + len + " but the sequence '" + fs.getId()\r
-                                                               + "' length is " + fs.getLength());\r
+                                               "All sequences must be of the same length. Please align the sequences " + \r
+                                               " prior to submission! The first sequence length is : " + len + \r
+                                               " but the sequence '" + fs.getId() + "' length is " + fs.getLength());\r
+                       }\r
+               }\r
+       }\r
+\r
+       public static void validateJpredInput(List<FastaSequence> sequences)\r
+                       throws JobSubmissionException {\r
+               validateFastaInput(sequences);\r
+               int len = 0;\r
+               for (FastaSequence fs : sequences) {\r
+                       if (len == 0) {\r
+                               len = fs.getLength();\r
+                               continue;\r
+                       }\r
+                       if (fs.getLength() != len) {\r
+                               System.out.println("FASTA rec: id = " + fs.getId() + ": seq = " + fs.getSequence());\r
+                               throw new JobSubmissionException(\r
+                                               "All sequences must be of the same length. Please align the sequences " + \r
+                                               " prior to submission! The first sequence length is : " + len + \r
+                                               " but the sequence '" + fs.getId() + "' length is " + fs.getLength());\r
                        }\r
                }\r
        }\r
@@ -171,8 +189,7 @@ public final class WSUtil {
                        throws ResultNotAvailableException {\r
                WSUtil.validateJobId(jobId);\r
                AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
-               ConfiguredExecutable<T> aacon = (ConfiguredExecutable<T>) asyncEngine\r
-                               .getResults(jobId);\r
+               ConfiguredExecutable<T> aacon = (ConfiguredExecutable<T>) asyncEngine.getResults(jobId);\r
                ScoreManager mas = aacon.getResults();\r
                log.trace(jobId + " getConservation : " + mas);\r
                return mas;\r