欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Jmeter 获取当前目录并创建文件夹  

程序员文章站 2022-07-13 21:40:36
...
import org.apache.jmeter.gui.GuiPackage;
import org.apache.commons.io.FilenameUtils;
import java.io.File;
import java.io.IOException;

String testPlanFileDir = FilenameUtils.getFullPathNoEndSeparator(GuiPackage.getInstance().getTestPlanFile());
testPlanFileDir = testPlanFileDir.replace("jmeter\\plans","target\\download");

File folder = new File(testPlanFileDir);
if(!folder.exists()){
	folder.mkdirs();
}