@Override public GetLinkTargetResponseProto getLinkTarget(RpcController controller, GetLinkTargetRequestProto req) throws ServiceException { try { String result = server.getLinkTarget(req.getPath()); GetLinkTargetResponseProto.Builder builder = GetLinkTargetResponseProto .newBuilder(); if (result != null) { builder.setTargetPath(result); } return builder.build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public String getLinkTarget(String path) throws AccessControlException, FileNotFoundException, IOException { GetLinkTargetRequestProto req = GetLinkTargetRequestProto.newBuilder() .setPath(path).build(); try { GetLinkTargetResponseProto rsp = rpcProxy.getLinkTarget(null, req); return rsp.hasTargetPath() ? rsp.getTargetPath() : null; } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public String getLinkTarget(String path) throws IOException { GetLinkTargetRequestProto req = GetLinkTargetRequestProto.newBuilder() .setPath(path).build(); try { GetLinkTargetResponseProto rsp = rpcProxy.getLinkTarget(null, req); return rsp.hasTargetPath() ? rsp.getTargetPath() : null; } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public GetLinkTargetResponseProto getLinkTarget(RpcController controller, GetLinkTargetRequestProto req) throws ServiceException { try { String result = server.getLinkTarget(req.getPath()); GetLinkTargetResponseProto.Builder builder = GetLinkTargetResponseProto.newBuilder(); if (result != null) { builder.setTargetPath(result); } return builder.build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public String getLinkTarget(String path) throws AccessControlException, FileNotFoundException, IOException { GetLinkTargetRequestProto req = GetLinkTargetRequestProto.newBuilder().setPath(path).build(); try { GetLinkTargetResponseProto rsp = rpcProxy.getLinkTarget(null, req); return rsp.hasTargetPath() ? rsp.getTargetPath() : null; } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }