Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

流方式读取文件,临时文件不会存在 但是临时文件夹依旧存在,想问问是我配置有问题吗?查阅文档之前是迭代了删除临时文件,但是这个临时文件夹是不会删除的吗? #4057

Open
HuiEr-ux opened this issue Dec 1, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@HuiEr-ux
Copy link

HuiEr-ux commented Dec 1, 2024

建议先去看文档

快速开始常见问题

异常代码

 InputStream inputStream = null;
        OSS ossClient = null;
        try {
            ossClient = new OSSClient(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret());
            inputStream = ossClient.getObject(ossConfig.getBucketName(), fileName).getObjectContent();
            if (Objects.nonNull(inputStream)) {
                EasyExcel.read(inputStream, CarExcel.class, new BatchExcelListener<T>())
                        .excelType(ExcelTypeEnum.XLSX)
                        .ignoreEmptyRow(Boolean.TRUE)
                        .sheet()
                        .headRowNumber(1)
                        .doRead();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
            if (Objects.nonNull(ossClient)) {
                ossClient.shutdown();
            }
            if (Objects.nonNull(inputStream)) {
                try {
                    inputStream.close();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

异常提示

easyexcel_q

问题描述

临时文件会被删除,但是临时文件夹依旧存在
不知道这是正常现象吗,有没有什么方法可以解决呢

@HuiEr-ux HuiEr-ux added the help wanted Extra attention is needed label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant