import jalview.ws.rest.InputType;
import jalview.ws.rest.NoValidInputDataException;
import jalview.ws.rest.RestJob;
+import jalview.ws.rest.RestServiceDescription;
import jalview.ws.rest.InputType.molType;
import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
import org.apache.http.entity.mime.content.ContentBody;
import org.apache.http.entity.mime.content.StringBody;
return new StringBody(new jalview.io.AnnotationFile().printCSVAnnotations(al.getAlignmentAnnotation()));
}
}
-}
\ No newline at end of file
+ @Override
+ public List<String> getURLEncodedParameter()
+ {
+ ArrayList<String> prms = new ArrayList<String>();
+ super.addBaseParams(prms);
+ prms.add("format='"+format+"'");
+ return prms;
+ }
+ @Override
+ public String getURLtokenPrefix()
+ {
+ return "ALANNOTATION";
+ }
+ @Override
+ public boolean configureProperty(String tok, String val,
+ StringBuffer warnings)
+ {
+
+ if (tok.startsWith("format"))
+ {
+ for (String fmt : new String[] { CSVANNOT, JVANNOT})
+ {
+ if (val.equalsIgnoreCase(fmt))
+ {
+ format = fmt;
+ return true;
+ }
+ }
+ warnings.append("Invalid annotation file format '" + val
+ + "'. Must be one of (");
+ for (String fmt : new String[] { CSVANNOT, JVANNOT})
+ {
+ warnings.append(" " + fmt);
+ }
+ warnings.append(")\n");
+ }
+ return false;
+ }
+}