X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Frest%2FRestJobThread.java;h=20b517b3c16db8c2bfab3092544f9513e7a4d894;hb=9d2408483e451285fd555c3cd6e0273977acbaa7;hp=951825a8607c6f9a85676de6c4f75b3ba8c5efe4;hpb=ab43013b7e357b84b4abade0dba949668dfb2a0e;p=jalview.git
diff --git a/src/jalview/ws/rest/RestJobThread.java b/src/jalview/ws/rest/RestJobThread.java
index 951825a..20b517b 100644
--- a/src/jalview/ws/rest/RestJobThread.java
+++ b/src/jalview/ws/rest/RestJobThread.java
@@ -1,6 +1,6 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
@@ -20,13 +20,15 @@
*/
package jalview.ws.rest;
+import java.util.Locale;
+
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentOrder;
import jalview.datamodel.Annotation;
-import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.HiddenColumns;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
@@ -90,8 +92,8 @@ public class RestJobThread extends AWSThread
{
jobs = new RestJob[1];
jobs[0] = new RestJob(0, this,
- restClient._input.getVisibleAlignment(restClient.service
- .getGapCharacter()),
+ restClient._input.getVisibleAlignment(
+ restClient.service.getGapCharacter()),
restClient._input.getVisibleContigs());
// need a function to get a range on a view/alignment and return both
// annotation, groups and selection subsetted to just that region.
@@ -101,15 +103,14 @@ public class RestJobThread extends AWSThread
{
int[] viscontig = restClient._input.getVisibleContigs();
AlignmentI[] viscontigals = restClient._input
- .getVisibleContigAlignments(restClient.service
- .getGapCharacter());
+ .getVisibleContigAlignments(
+ restClient.service.getGapCharacter());
if (viscontigals != null && viscontigals.length > 0)
{
jobs = new RestJob[viscontigals.length];
for (int j = 0; j < jobs.length; j++)
{
- int[] visc = new int[]
- { viscontig[j * 2], viscontig[j * 2 + 1] };
+ int[] visc = new int[] { viscontig[j * 2], viscontig[j * 2 + 1] };
if (j != 0)
{
jobs[j] = new RestJob(j, this, viscontigals[j], visc);
@@ -174,9 +175,13 @@ public class RestJobThread extends AWSThread
private String getStage(Stage stg)
{
if (stg == Stage.SUBMIT)
+ {
return "submitting ";
+ }
if (stg == Stage.POLL)
+ {
return "checking status of ";
+ }
return (" being confused about ");
}
@@ -230,8 +235,8 @@ public class RestJobThread extends AWSThread
{
if (input.getValue().validFor(rj))
{
- postentity.addPart(input.getKey(), input.getValue()
- .formatForInput(rj));
+ postentity.addPart(input.getKey(),
+ input.getValue().formatForInput(rj));
}
else
{
@@ -286,10 +291,7 @@ public class RestJobThread extends AWSThread
break;
case 202:
rj.statMessage = "
Job submitted successfully. Results available at this URL:\n"
- + ""
- + rj.getJobId()
+ + "" + rj.getJobId()
+ "
";
rj.running = true;
break;
@@ -302,11 +304,9 @@ public class RestJobThread extends AWSThread
{
if (loc.length > 1)
{
- Cache.log
- .warn("Ignoring additional "
- + (loc.length - 1)
- + " location(s) provided in response header ( next one is '"
- + loc[1].getValue() + "' )");
+ Cache.log.warn("Ignoring additional " + (loc.length - 1)
+ + " location(s) provided in response header ( next one is '"
+ + loc[1].getValue() + "' )");
}
rj.setJobId(loc[0].getValue());
rj.setSubmitted(true);
@@ -320,8 +320,8 @@ public class RestJobThread extends AWSThread
rj.setSubjobComplete(true);
rj.error = true;
rj.running = false;
- completeStatus(rj, response, "" + getStage(stg)
- + "failed. Reason below:\n");
+ completeStatus(rj, response,
+ "" + getStage(stg) + "failed. Reason below:\n");
break;
default:
// Some other response. Probably need to pop up the content in a window.
@@ -334,16 +334,10 @@ public class RestJobThread extends AWSThread
rj.setSubmitted(true);
try
{
- completeStatus(
- rj,
- response,
- ""
- + getStage(stg)
- + " resulted in an unexpected server response.
Url concerned was "
- + request.getURI()
- + "
Filtered response content below:
");
+ completeStatus(rj, response, "" + getStage(stg)
+ + " resulted in an unexpected server response.
Url concerned was " + request.getURI()
+ + "
Filtered response content below:
");
} catch (IOException e)
{
Cache.log.debug("IOException when consuming unhandled response",
@@ -409,7 +403,7 @@ public class RestJobThread extends AWSThread
*/
String f;
StringBuffer content = new StringBuffer(f = EntityUtils.toString(en));
- f = f.toLowerCase();
+ f = f.toLowerCase(Locale.ROOT);
int body = f.indexOf("