Java 如何更改ConvertToExcel Nifi处理器中的ZipSecureRefile.setMinInflateRatio()?

Java 如何更改ConvertToExcel Nifi处理器中的ZipSecureRefile.setMinInflateRatio()?,java,excel,apache-poi,apache-nifi,Java,Excel,Apache Poi,Apache Nifi,我正在尝试接收Excel文件(.xlsx),我的Nifi流的一部分(第二步)使用预配置的ConvertExcelToCSV Nifi处理器,但是,一些Excel文件超出了默认压缩比,导致Zip炸弹检测器失效 我已尝试将\nifi master\nifi nar bundles\nifi poi bundle\nifi poi pundle\nifi poi processors\src\main\java\org\apache\nifi\processors\poi filepath中的Conv

我正在尝试接收Excel文件(.xlsx),我的Nifi流的一部分(第二步)使用预配置的ConvertExcelToCSV Nifi处理器,但是,一些Excel文件超出了默认压缩比,导致Zip炸弹检测器失效

我已尝试将\nifi master\nifi nar bundles\nifi poi bundle\nifi poi pundle\nifi poi processors\src\main\java\org\apache\nifi\processors\poi filepath中的ConvertExceltToCSV.java文件中的ZipSecureFile.setMinInflateRatio()设置为0,但即使在重置nifi之后,它仍然抛出ZipBomb检测到的错误,并且不会将需要的.xlsx文件转换为CSV

public void onTrigger(最终ProcessContext上下文,最终ProcessSession会话)抛出ProcessException{
final FlowFile FlowFile=session.get();
ZipSecureFile.setMinInflateRatio(0);
if(flowFile==null){
返回;
}
最终字符串desiredSheetsDelimited=context.getProperty(所需的工作表)。evaluateAttributeExpressions(flowFile).getValue();
final boolean formatValues=context.getProperty(FORMAT_VALUES).asBoolean();
final CSVFormat CSVFormat=CSVUtils.createCSVFormat(上下文,flowFile.getAttributes());
//切换到基于0的索引
final int firstRow=context.getProperty(行到行跳过).evaluateAttributeExpressions(流文件).asInteger()-1;
最终字符串[]sColumnsToSkip=StringUtils
.split(context.getProperty(列_至_跳过).evaluateAttributeExpressions(流文件).getValue(),“,”);
最终列表列stoskip=new ArrayList();
if(sColumnsToSkip!=null&&sColumnsToSkip.length>0){
for(字符串c:sColumnsToSkip){
试一试{
//切换到基于0的索引
columnsToSkip.add(Integer.parseInt(c)-1);
}捕获(数字格式){
抛出新的ProcessException(“要跳过列表的列中的无效列。”,e);
}
}
}
...
}

我想将MinInflateRatio设置为0或其他一些空值,这样无论压缩比如何,Nifi都会将我需要的页面从工作簿转换为CSV。如果您有任何建议或帮助,我们将不胜感激。

对于Nifi一无所知。但是zip炸弹检查是在实例化
ZipPackage
时进行的。因此,
convertexcelltotocv.java
中的某个地方将是一个实例化
XSSFWorkbook
wordbook
OPCPackage
的方法。在实例化之前,ZipSecureRefile.setMinInflateRatio(0)必须放置。