Posted by : Rhyf Ahmad Thursday, May 21, 2015

In this chapter, you explore how you identify, access, and manipulate files and directories (sometimes referred to as folders) on your hard drive. This includes the ability to create, copy, move, and delete files and directories. You learn how you read and write files starting in the next chapter. Java has more than one way to work with files and directories.

The original capability came with JDK 1.0. This was augmented in JDK 1.4 with NIO (New I/O). I only discuss the latest and greatest facility for file operations referred to as NIO2 that was introduced in JDK 7.
The starting point for working with files and directories is a java.nio.file.FileSystem object. A FileSystem object encapsulates the file storage system on your computer. What this storage system consists of and how it is organized depends on the operating system you are using. The FileSystem class has no public constructors so you need another way to create such an object.

Contents:

Accessing the File System
Working with Path Objects
  1. Accessing System Properties
  2. Setting System Properties
  3. Testing and Checking Path Objects
  4. Querying Files and Directories
  5. Obtaining File Attributes
  6. Other Path Operations

Creating and Deleting Directories and Files
  1. Creating Directories
  2. Creating Files
  3. Deleting Files and Directories

Getting the Contents of a Directory
Closing a Stream
Moving and Copying Files and Directories
  1. Renaming a File or Directory
  2. Copying Files and Directories
  3. Walking a File Tree 




Ebook Preview
Get the ebook now (1.15 MB)

If the link above doesn't work, try the link below


Mirror: Get the ebook now (1.15 MB)

Leave a Reply

You can leave a comment to request any article(s), software(s), ebook(s) or report the dead link.
Then I will reply as soon as I can :)

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Recent Post

Recent Posts Widget
Instagram

- Copyright © Madriva -Robotic Notes- Powered by Blogger - Designed by Johanes Djogan -