X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Frest%2Fparams%2FAlignment.java;h=4426c5f7e79d041e6e0589bdce37b77d21fe5f30;hb=353511c16c62e2f5a0bef407646b3f47dbb9e68c;hp=a8258e2e63fd0527725735b14f79f896f6e1e2e5;hpb=95ebbef7b78bf266a8252bd479510be3c80cd234;p=jalview.git diff --git a/src/jalview/ws/rest/params/Alignment.java b/src/jalview/ws/rest/params/Alignment.java index a8258e2..4426c5f 100644 --- a/src/jalview/ws/rest/params/Alignment.java +++ b/src/jalview/ws/rest/params/Alignment.java @@ -79,11 +79,11 @@ public class Alignment extends InputType try { File fa = File.createTempFile("jvmime", ".fa"); - PrintWriter pw = new PrintWriter( - new OutputStreamWriter(new BufferedOutputStream( - new FileOutputStream(fa)), "UTF-8")); - pw.append(new FormatAdapter().formatSequences(format, - alignment, jvsuffix)); + PrintWriter pw = new PrintWriter(new OutputStreamWriter( + new BufferedOutputStream(new FileOutputStream(fa)), + "UTF-8")); + pw.append(new FormatAdapter().formatSequences(format, alignment, + jvsuffix)); pw.close(); return new FileBody(fa, "text/plain"); } catch (Exception ex) @@ -108,8 +108,8 @@ public class Alignment extends InputType @Override public List getURLEncodedParameter() { - ArrayList prms = new ArrayList(); - prms.add("format='" + format + "'"); + List prms = new ArrayList(); + prms.add("format='" + format.getName() + "'"); if (type != null) { prms.add("type='" + type.toString() + "'"); @@ -156,8 +156,8 @@ public class Alignment extends InputType return true; } } - warnings.append("Invalid alignment format '" + val - + "'. Must be one of ("); + warnings.append( + "Invalid alignment format '" + val + "'. Must be one of ("); for (String fmt : FileFormats.getInstance().getWritableFormats(true)) { warnings.append(" ").append(fmt); @@ -172,8 +172,8 @@ public class Alignment extends InputType return true; } catch (Exception x) { - warnings.append("Invalid molecule type '" + val - + "'. Must be one of ("); + warnings.append( + "Invalid molecule type '" + val + "'. Must be one of ("); for (molType v : molType.values()) { warnings.append(" " + v); @@ -195,12 +195,12 @@ public class Alignment extends InputType "Append jalview style /start-end suffix to ID", false, false, writeAsFile, null)); - List writable = FileFormats - .getInstance().getWritableFormats(true); + List writable = FileFormats.getInstance() + .getWritableFormats(true); lst.add(new Option("format", "Alignment upload format", true, - FileFormat.Fasta.toString(), format.getName(), writable, + FileFormat.Fasta.toString(), format.getName(), writable, null)); + lst.add(createMolTypeOption("type", "Sequence type", false, type, null)); - lst.add(createMolTypeOption("type", "Sequence type", false, type, null)); return lst; }