Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12377989
  • 博文数量: 1293
  • 博客积分: 13501
  • 博客等级: 上将
  • 技术积分: 17974
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-08 18:11
文章分类

全部博文(1293)

文章存档

2019年(1)

2018年(1)

2016年(118)

2015年(257)

2014年(128)

2013年(222)

2012年(229)

2011年(337)

分类: Java

2014-12-23 11:49:53

读取固定文件夹中文件,本方法不适合文件夹中还有文件夹的情况

  1. String fileDirPath = 具体路径;
  2.         File root = new File(fileDirPath);
  3.         
  4.         if (!root.exists() || !root.isDirectory())
  5.         {
  6.             System.out.println("is not directory");
  7.             return isAllExists=false;
  8.         }
  9.         
  10.         File[] files = root.listFiles();
          
        /* 个性化处理 .....*/
  1.         Hashtable<String, File> htLocalFile = new Hashtable<String, File>();
  2.         for (File file : files)
  3.             htLocalFile.put(file.getName(), file);

创建文件夹方法:

  1. File root = new File(localFileDir);
  2.                         if (!root.exists())
  3.                             root.mkdirs();

参考文献:
http://blog.csdn.net/hapylong/article/details/4594130
阅读(3231) | 评论(1) | 转发(1) |
给主人留下些什么吧!~~

lwy200002014-12-29 10:08:56

很好的想法

http://chanelbagscn.com/chanle-big-28.html
http://chanelbagscn.com/chanle-big-22.html