得到byte []的泽西客户端

时间:2017-10-22 11:18:40

标签: java rest jersey client

我试图编写一个泽西客户端代码,该代码从服务中获取字节数组但我收到错误  我的客户代码是:

VPS

我的服务代码是:

public static byte[] downloadClient(String id){
        Client client = Client.create();

        WebResource webResource = client.resource(url +"/downloadFile/"+id);
        ClientResponse response = 
        webResource.accept("application/json").get(ClientResponse.class);

        byte[] buf = response.getEntity(byte[].class);
        Desktop desktop = null;
        desktop = Desktop.getDesktop();

        return buf;


        }

那有什么不对?

0 个答案:

没有答案
相关问题