Beanshell post processor写文件

byte[] responseData = prev.getResponseData().;

private String filePath = "F:/test.txt";

BufferedOutputStream bos = null;

FileOutputStream fos = null;

File file = null;try

{

File file = new File(filePath);

fos = new FileOutputStream(file, true);// 不添加参数true,以非追加的方式添加内容

bos = new BufferedOutputStream(fos);

bos.write(responseData);

}catch(

Exception e)

{

e.printStackTrace();

}finally

{

if (bos != null) {

try {

bos.close();

} catch (IOException e1) {

e1.printStackTrace();

}

}

if (fos != null) {

try {

fos.close();

} catch (IOException e1) {

e1.printStackTrace();

}

}

}

 

Beanshell post processor写文件
    byte[] responseData = prev.getResponseData().;
    private String filePath = "F:/test.txt";
    BufferedOutputStream bos = null;
    FileOutputStream fos = null;
    File file = null;try
    {
        File file = new File(filePath);
        fos = new FileOutputStream(file, true);// 不添加参数true,以非追加的方式添加内容
        bos = new BufferedOutputStream(fos);
        bos.write(responseData);
    }catch(
    Exception e)
    {
        e.printStackTrace();
    }finally
    {
        if (bos != null) {
            try {
                bos.close();
            } catch (IOException e1) {
                e1.printStackTrace();
            }
        }
        if (fos != null) {
            try {
                fos.close();
            } catch (IOException e1) {
                e1.printStackTrace();
            }
        }
    }
View Code

 

上一篇:Oracle OCP 19c 认证1Z0-083考试题库(第4题)


下一篇:【郑州校区】BOS v2.0物流管理平台整体概述