package jalview.ws2.client.jpred4;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
@Override
public AlignFile getAlignmentFile(WebServiceJobHandle job) throws IOException
{
- var url = client.getResultURL(job.getJobId(), ResultTypes.PSIBLAST_ALIGN);
- return new FastaFile(url.toString(), DataSourceType.URL);
+ var stream = client.getResultStream(job.getJobId(), ResultTypes.PSIBLAST_ALIGN);
+ var buffer = new byte[2048];
+ var file = new ByteArrayOutputStream();
+ var len = 0;
+ while ((len= stream.read(buffer)) >= 0)
+ file.write(buffer, 0, len);
+ return new FastaFile(file.toString("UTF-8"), DataSourceType.PASTE);
}
@Override
public JPredFile getPredictionFile(WebServiceJobHandle job) throws IOException
{
- var url = client.getResultURL(job.getJobId(), ResultTypes.CONCISE);
- return new JPredFile(url.toString(), DataSourceType.URL);
+ var stream = client.getResultStream(job.getJobId(), ResultTypes.CONCISE);
+ var buffer = new byte[2048];
+ var file = new ByteArrayOutputStream();
+ var len = 0;
+ while ((len= stream.read(buffer)) >= 0)
+ file.write(buffer, 0, len);
+ return new JPredFile(file.toString("UTF-8"), DataSourceType.PASTE);
}
}