我需要访问附加到JIRA票证的远程excel文件https://wim-example.com/rest/api/2/issue/SDLCDEVOPS-3238/abc.xlsx。每次我访问JIRA票证时,我都必须为连接添加身份验证令牌。我必须使用带输入流的XSSFWorkbook
URLConnection con1 = url1.openConnection();
con1.setRequestProperty("Authorization", "Basic dTU3NjI3MjpGcmVtb250MTIz");
如何获取可以提供给XSSFWorkbook的输入流?
想出如何提供输入流:
Connection.getInputStream()
URLConnection con1 = url1.openConnection();
con1.setRequestProperty("Authorization", "Basic dTU3NjI3MjpGcmVtb250MTIz");
XSSFWorkbook fs = new XSSFWorkbook(con1.getInputStream());