Beispiel #1
0
 public synchronized void messageArrived(DoorTransferFinishedMessage message) {
   HttpProtocolInfo pinfo = (HttpProtocolInfo) message.getProtocolInfo();
   int sessionId = pinfo.getSessionId();
   Companion companion = _companions.get(sessionId);
   if (companion != null) {
     companion.messageArrived(message);
   }
 }
 public HttpGetResponse(
     long fileSize, NettyTransferService<HttpProtocolInfo>.NettyMoverChannel file) {
   super(HTTP_1_1, OK);
   HttpProtocolInfo protocolInfo = file.getProtocolInfo();
   headers().add(ACCEPT_RANGES, BYTES);
   headers().add(CONTENT_LENGTH, fileSize);
   String digest = buildDigest(file);
   if (!digest.isEmpty()) {
     headers().add(DIGEST, digest);
   }
   headers()
       .add(
           "Content-Disposition",
           contentDisposition(
               protocolInfo.getDisposition(), FsPath.create(protocolInfo.getPath()).name()));
   if (protocolInfo.getLocation() != null) {
     headers().add(CONTENT_LOCATION, protocolInfo.getLocation());
   }
 }