JavaSE - NIO —— File与NIO File功能对应
来源:互联网 发布:mac怎样装搜狗输入法 编辑:程序博客网 时间:2024/06/08 12:38
java.io.File Functionality
java.nio.file Functionality
Tutorial Coverage
java.io.File
java.nio.file.Path
The Path Class
java.io.RandomAccessFile
The SeekableByteChannel functionality.
Random Access Files
File.canRead, canWrite, canExecute
Files.isReadable, Files.isWritable, and Files.isExecutable.
On UNIX file systems, theManaging Metadata (File and File Store Attributes) package is used to check the nine file permissions.
Checking a File or Directory
Managing Metadata
File.isDirectory(), File.isFile(), and File.length()
Files.isDirectory(Path, LinkOption...), Files.isRegularFile(Path, LinkOption...), and Files.size(Path)
Managing Metadata
File.lastModified() and File.setLastModified(long)
Files.getLastModifiedTime(Path, LinkOption...) and Files.setLastMOdifiedTime(Path, FileTime)
Managing Metadata
The File methods that set various attributes: setExecutable, setReadable, setReadOnly, setWritable
These methods are replaced by the Files method setAttribute(Path, String, Object, LinkOption...).
Managing Metadata
new File(parent, "newfile")
parent.resolve("newfile")
Path Operations
File.renameTo
Files.move
Moving a File or Directory
File.delete
Files.delete
Deleting a File or Directory
File.createNewFile
Files.createFile
Creating Files
File.deleteOnExit
Replaced by the DELETE_ON_CLOSE option specified in the createFile method.
Creating Files
File.createTempFile
Files.createTempFile(Path, String, FileAttributes<?>), Files.createTempFile(Path, String, String, FileAttributes<?>)
Creating Files
Creating and Writing a File by Using Stream I/O
Reading and Writing Files by Using Channel I/O
File.exists
Files.exists and Files.notExists
Verifying the Existence of a File or Directory
File.compareTo and equals
Path.compareTo and equals
Comparing Two Paths
File.getAbsolutePath and getAbsoluteFile
Path.toAbsolutePath
Converting a Path
File.getCanonicalPath and getCanonicalFile
Path.toRealPath or normalize
Converting a Path (toRealPath)
Removing Redundancies From a Path (normalize)
File.toURI
Path.toURI
Converting a Path
File.isHidden
Files.isHidden
Retrieving Information About the Path
File.list and listFiles
Path.newDirectoryStream
Listing a Directory's Contents
File.mkdir and mkdirs
Path.createDirectory
Creating a Directory
File.listRoots
FileSystem.getRootDirectories
Listing a File System's Root Directories
File.getTotalSpace, File.getFreeSpace, File.getUsableSpace
FileStore.getTotalSpace, FileStore.getUnallocatedSpace, FileStore.getUsableSpace, FileStore.getTotalSpace
File Store Attributes
- JavaSE - NIO —— File与NIO File功能对应
- File NIO DEMO
- java nio copy file
- JAVA NIO:Path ,File
- JAVA NIO:Path ,File
- NIO - File Locking
- Java NIO —— 用 Path 取代 File
- File相关操作,java.nio.file.*
- java.nio.file深度剖析
- Eclipse之没有nio.file
- NIO中的File文件操作
- File操作-使用NIO进行文件的读写与复制
- NIO(二)--file与path的结合使用
- Java I/O流(二)——File,Properties,PrintWriter,IO ,RandomAccessFile,ByteBuffer,nio
- java 7 /java.nio.file 文件监控!!!
- JDK1.7 java.nio.file.Path
- 文件变化监视 java.nio.file.WatchService
- java.nio.file中的Paths类
- Config Huge Pages
- HOJ 1455 The Settlers of Catan
- Hadoop生态图谱
- MPMediaPickerController 选取本地音频
- JAXB学习一 (入门)
- JavaSE - NIO —— File与NIO File功能对应
- 待写的一些东西
- MPMoviePlayerController 电影播放器—IOS开发
- 基于visual Studio2013解决面试题之0507字符串转整数
- JAXB学习二 (类型绑定)
- PHP 目录操作
- linux常用头文件之--linux/device.h
- 黑马程序员 eclipse的使用
- Improving performance of reading text from a large text file