如何使用pentaho下载二进制文件?

如何使用pentaho下载二进制文件?,pentaho,Pentaho,pentaho的Http客户端步骤只允许下载文本文件 如何使用Pentaho下载二进制文件?使用以下代码添加修改过的Java脚本值 var fileURL = "https://hp.imguol.com.br/c/home/b1/2018/05/26/mohamed-salah-chora-apos-se-machucar-em-lance-com-sergio-ramos-1527363329053_300x300.jpg"; var url = java.net.URL(fileURL)

pentaho的
Http客户端
步骤只允许下载文本文件


如何使用Pentaho下载二进制文件?

使用以下代码添加修改过的Java脚本值

var fileURL = "https://hp.imguol.com.br/c/home/b1/2018/05/26/mohamed-salah-chora-apos-se-machucar-em-lance-com-sergio-ramos-1527363329053_300x300.jpg";

var url = java.net.URL(fileURL);    

var httpConn = url.openConnection();

// opens input stream from the HTTP connection
var inputStream = httpConn.getInputStream();
var saveFilePath = "d:/myfile10.jpg";      


var bis = java.io.BufferedInputStream(inputStream);
var bos = java.io.BufferedOutputStream(java.io.FileOutputStream(java.io.File(saveFilePath)));
var inByte;
while((inByte = bis.read()) != -1) {
    bos.write(inByte);
}
bis.close();
bos.close();