我正在编写一个肥皂网络服务来从本机下载文件,但是以下错误来了

时间:2019-01-12 20:17:15

标签: java web-services soap

以下例外即将到来

  

异常:java.lang.RuntimeException:   java.lang.ClassNotFoundException:   org.glassfish.jersey.internal.RuntimeDelegateImpl消息:   java.lang.RuntimeException:java.lang.ClassNotFoundException:   org.glassfish.jersey.internal.RuntimeDelegateImpl


代码

package com.hoja; 
import java.io.File; 
import java.io.FilePermission; 
import javax.ws.rs.Produces; 
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.ResponseBuilder; 
public class BhaiHoja { 
  @Produces("application/pdf") 
  public Response getFile(String policyNo, String docId){
    String constFilePath = "C:/Users/Anushree/Desktop/Webservice/"; 
    String flow = (constFilePath + "/" + policyNo + "/" + docId +".pdf"); 
    File fileNew = new File(constFilePath + "/" + policyNo + "/" + docId +".pdf"); 
    File FilePath = new File("C:/Users/Anushree/Desktop/Webservice/"); FilePermission permission = new FilePermission(flow, "read");  ResponseBuilder 
    res = Response.ok((Object)fileNew ); 
    res.header("content-disposition","attachment;filename=fileNew");  
    return res.build(); 
  } 
}

0 个答案:

没有答案