Skip to content

Commit

Permalink
bug fix: retrieve sequence string for transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
hplahar committed Nov 11, 2020
1 parent ff33207 commit 8858543
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/org/jbei/ice/lib/net/RemoteTransfer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import org.jbei.ice.storage.model.Entry;
import org.jbei.ice.storage.model.RemotePartner;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -195,8 +197,12 @@ protected void performTransfer(RemotePartner partner, PartData data) {
if (sequenceDAO.hasSequence(data.getId())) {
InputStreamWrapper wrapper = new SequenceAsString(SequenceFormat.GENBANK, data.getId(), true).get();
if (wrapper != null && wrapper.getInputStream() != null) {
String sequenceString = wrapper.getInputStream().toString();
remoteContact.transferSequence(url, data.getRecordId(), data.getType(), sequenceString);
try {
String sequenceString = new String(wrapper.getInputStream().readAllBytes(), StandardCharsets.UTF_8);
remoteContact.transferSequence(url, data.getRecordId(), data.getType(), sequenceString);
} catch (IOException e) {
Logger.error("Cannot transfer sequence", e);
}
}
}

Expand Down

0 comments on commit 8858543

Please sign in to comment.