X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Frest%2Fparams%2FAlignment.java;h=0027057390c4fde89434f92b8afbb2340eefb4f9;hb=ccd341fe829d12e0ec54be126ad561a7ce1a2987;hp=922f933a0146f22707860339c77b8faaae7562a3;hpb=f5d48464f668eb2ffd8f6cdcd0d04ff5658c54fc;p=jalview.git diff --git a/src/jalview/ws/rest/params/Alignment.java b/src/jalview/ws/rest/params/Alignment.java index 922f933..0027057 100644 --- a/src/jalview/ws/rest/params/Alignment.java +++ b/src/jalview/ws/rest/params/Alignment.java @@ -7,11 +7,14 @@ import jalview.ws.rest.RestJob; import jalview.ws.rest.InputType.molType; import java.io.BufferedOutputStream; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; +import java.io.StringWriter; import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import java.nio.charset.Charset; import org.apache.http.entity.mime.content.ContentBody; @@ -53,9 +56,13 @@ public class Alignment extends InputType { throw new NoValidInputDataException("Couldn't write out alignment to file.",ex); } } else { - StringBody sb = new StringBody(new jalview.io.FormatAdapter().formatSequences(format, alignment, jvsuffix)); // , "text/plain", Charset.forName("UTF-8")); + jalview.io.FormatAdapter fa = new jalview.io.FormatAdapter(); + fa.setNewlineString("\r\n"); + return new StringBody((fa.formatSequences(format, alignment, jvsuffix))); + //, + //"text/plain",Charset.forName("UTF-8")); + // , "text/plain", Charset.forName("UTF-8")); // sb.getContentTypeParameters().put("filename", "alignment.fa"); - return sb; } } } \ No newline at end of file