コード例 #1
0
 private static Optional<String> getClientHost(SrmPrepareToPutRequest request) {
   if (request.getTransferParameters() != null
       && request.getTransferParameters().getArrayOfClientNetworks() != null) {
     String[] clientNetworks =
         request.getTransferParameters().getArrayOfClientNetworks().getStringArray();
     if (clientNetworks != null && clientNetworks.length > 0 && clientNetworks[0] != null) {
       return Optional.of(clientNetworks[0]);
     }
   }
   return Optional.absent();
 }
コード例 #2
0
 private String[] getProtocols() throws SRMInvalidRequestException {
   String[] protocols = null;
   TTransferParameters transferParameters = request.getTransferParameters();
   if (transferParameters != null && transferParameters.getArrayOfTransferProtocols() != null) {
     protocols = transferParameters.getArrayOfTransferProtocols().getStringArray();
   }
   protocols = Tools.trimStringArray(protocols);
   if (protocols == null || protocols.length < 1) {
     throw new SRMInvalidRequestException("request contains no transfer protocols.");
   }
   return protocols;
 }