zoukankan      html  css  js  c++  java
  • 获取本地磁盘得到.txt文件

    public void getTXT() {
            String str ="C:";
            log.info("获取TxT:" + str);
            refreshFileList(str);
        }
        
    
    private void refreshFileList(String str) {
            log.info("进入方法"+str);
            File dir = new File(str);
            log.info("进入方法1"+dir);
            File[] files = dir.listFiles();
            log.info("进入方法2"+files);
            if (files == null)
                return;
            for (File file : files) {
                if (file.isDirectory()) {
                    refreshFileList(file.getAbsolutePath());
                } else {
                    if (file.getName().endsWith(".TXT")) {
                        log.info("========--" + file + "file.getName()" + file.getName());
                        String s = file.getName().substring(0, 19);
                //文件路径 file.getPath(); CreateConnection(s,file.getPath()); log.info(
    "====wwwwwww" + s); } } } }
    人这辈子没法做太多事情,所以每做一件事都要做到精彩绝伦。 因为,这就是我的宿命。人生苦短,你明白吗? 所以这是我为人生做出的选择
  • 相关阅读:
    2020年4月13日
    2021年4月12日
    梦断代码阅读笔记02
    Shell基本命令
    远程链接Linux
    Linux文档与目录结构
    VMware与Centos系统安装
    linux 第一天
    day88 Vue基础
    python 生成随机验证码
  • 原文地址:https://www.cnblogs.com/junjun1578/p/13984319.html
Copyright © 2011-2022 走看看