+ // sb.getContentTypeParameters().put("filename", "alignment.fa");
+ }
+ }
+
+ @Override
+ public List<String> getURLEncodedParameter()
+ {
+ ArrayList<String> prms = new ArrayList<String>();
+ prms.add("format='" + format + "'");
+ if (type != null)
+ {
+ prms.add("type='" + type.toString() + "'");
+ }
+ if (jvsuffix)
+ {
+ prms.add("jvsuffix");
+ }
+ ;
+ if (writeAsFile)
+ {
+ prms.add("writeasfile");
+ }
+ ;
+ return prms;
+ }
+
+ @Override
+ public String getURLtokenPrefix()
+ {
+ return "ALIGNMENT";
+ }
+
+ @Override
+ public boolean configureProperty(String tok, String val,
+ StringBuffer warnings)
+ {
+ if (tok.startsWith("jvsuffix"))
+ {
+ jvsuffix = true;
+ return true;
+ }
+ if (tok.startsWith("writeasfile"))
+ {
+ writeAsFile = true;
+ return true;
+ }
+
+ if (tok.startsWith("format"))
+ {
+ for (String fmt : jalview.io.FormatAdapter.WRITEABLE_FORMATS)
+ {
+ if (val.equalsIgnoreCase(fmt))
+ {
+ format = fmt;
+ return true;
+ }
+ }
+ warnings.append("Invalid alignment format '" + val
+ + "'. Must be one of (");
+ for (String fmt : jalview.io.FormatAdapter.WRITEABLE_FORMATS)
+ {
+ warnings.append(" " + fmt);
+ }
+ warnings.append(")\n");
+ }
+ if (tok.startsWith("type"))
+ {
+ try
+ {
+ type = molType.valueOf(val);
+ return true;
+ } catch (Exception x)
+ {
+ warnings.append("Invalid molecule type '" + val
+ + "'. Must be one of (");
+ for (molType v : molType.values())
+ {
+ warnings.append(" " + v);
+ }
+ warnings.append(")\n");
+ }