apache-comnons系列之commons-io-2.5 org.apache.commons.io.FileUtils学习笔记
来源:互联网 发布:淘宝网代理加盟 编辑:程序博客网 时间:2024/06/05 21:51
apache-comnons系列之commons-io-2.5 org.apache.commons.io.FileUtils学习笔记
概述
- Facilities are provided in the following areas:
- writing to a file
- reading from a file
- converting to and from a URL
- comparing file content
- file last changed date
- calculating a checksum
- make a directory including parent directories
- copying files and directories
- deleting files and directories
- listing files and directories by filter and extension
测试
- org.apache.commons.io.FileUtilsTestCase
- directory
- forceMkdir
- Makes a directory, including any necessary but nonexistent parent directories.
- copyFile
- This method copies the contents of the specified source file to the specified destination file. The directory holding the destination file is created if it does not exist. If the destination file exists, then this method will overwrite it
- doCopyFile完成复制
- deleteDirectory
- Deletes a directory recursively
- cleanDirectory/directory.delete
- listFiles
- Finds files within a given directory (and optionally its subdirectories). All files found are filtered by an IOFileFilter.
- innerListFiles–FileFilterUtils.or–directory.listFiles((FileFilter) filter)
- forceMkdir
- file
- getFile/toFile
- Construct a file from the set of name elements
- openInputStream/openOutputStream
- toURLs
- Converts each of an array of
File
to aURL
.
- Converts each of an array of
- isFileNewer
- Tests if the specified
File
is newer than the referenceFile
.
- Tests if the specified
- byteCountToDisplaySize
- Returns a human-readable version of the file size, where the input represents a specific number of bytes
- contentEquals
- This method checks to see if the two files are different lengths or if they point to the same file, before resorting to byte-by-byte comparison of the contents.
- IOUtils.contentEquals(input1, input2)
- getFile/toFile
FilenameUtils
- This class defines six components within a filename
- (example C:\dev\project\file.txt):
- the prefix - C:\
- the path - dev\project\
- the full path - C:\dev\project\
- the name - file.txt
- the base name - file
- the extension - txt
阅读全文
0 0
- apache-comnons系列之commons-io-2.5 org.apache.commons.io.FileUtils学习笔记
- apache-comnons系列之commons-io-2.5 org.apache.commons.io.IOUtils学习笔记
- org.apache.commons.io.FileUtils学习
- org.apache.commons.io——FileUtils学习笔记
- apache-comnons系列之commons-collections4 org.apache.commons.collections4.CollectionUtils学习笔记
- org.apache.commons.io.FileUtils使用
- org.apache.commons.io.FileUtils使用详解
- org.apache.commons.io Class FileUtils
- org.apache.commons.io.FileUtils的使用
- apache-comnons系列之commons-lang3 学习笔记1
- apache-comnons系列之commons-codec1.11 学习笔记
- apache-comnons系列之commons-dbutils1.7 学习笔记
- apache-comnons系列之commons-fileupload1.3.3 学习笔记
- apache-comnons系列之commons-compress1.14 学习笔记
- apache-comnons系列之commons-math3.6 学习笔记
- apache-comnons系列之commons-pool2.4 学习笔记
- apache-comnons系列之commons-email1.4 学习笔记
- apache-comnons系列之commons-net3.6 学习笔记
- AQS简单总结
- js中list和map中添加元素
- 一分钟了解“张量 及其 展开”
- emacs 自带的简单入门教程(TUTORIAL)
- 网易云JAVA入门编程题5-2
- apache-comnons系列之commons-io-2.5 org.apache.commons.io.FileUtils学习笔记
- POJ -- 2443 Set Operation 【 二进制压位 】
- Go语言切片前或中间插入项与内置copy()函数
- 排序--快速排序分析
- Feescale K60开发笔记15: 更改MAC地址
- ArrayList和LinkedList的区别
- mongodb搭建与使用
- C语言实现三子棋
- java基础第三篇