Friday Oct 05, 2012

JavaOne 2012 - The Power of Java 7 NIO.2

At JavaOne 2012, Mohamed Taman of e-finance gave a presentation highlighting the power of NIO.2, the file I/O APIs introduced in JDK 7. He shared information on how to get the most out of NIO.2, gave tips on migrating your I/O code to NIO.2, and presented case studies.

The File I/O (featuring NIO.2) lesson in the Java Tutorials has extensive coverage of NIO.2 and includes the following topics:

From the conference session page, you can watch the presentation or download the materials.

Saturday Jul 25, 2009

NIO.2 Updates in JDK7

If you are already using the new file I/O API provided in JDK7, you should be aware that there are some minor API changes as of build 64. If you are using the JavaOne Preview release, the changes have not yet been integrated, but they are available now on java.net.

The API is changed as follows:

  • Path.delete(boolean) is now Path.deleteIfExists(). So, delete(true) is equivalent to delete(), and delete(false) is equivalent to deleteIfExists().
  • The time stamp methods in the Attribute class that took long, TimeUnit arguments now take an instance of the new FileTime class. Similarly, the BasicFileAttributes time stamp methods now return an instance of FileTime. The new method signatures are:
    • Attributes.setLastAccessTime(FileRef, FileTime)
    • Attributes.setLastModifiedTime(FileRef, FileTime)
    • FileTime creationTime() in BasicFileAttributes
    • FileTime lastAccessTime() in BasicFileAttributes
    • FileTime lastModifiedTime() in BasicFileAttributes
  • The BasicFileAttribute.linkCount() method has been removed.
  • The BasicFileAttribute.resolution() method has been removed.

The File I/O lesson in the Java Tutorials has been updated with the new API.

-- Sharon Zakhour

Wednesday May 27, 2009

Just released -- Java Tutorials update

To coincide with the JDK7 Preview Release and JavaOne, we have just published an updated version of the Java Tutorials. Besides fixing many typos and errors that you have reported, this release includes:

  • An entirely reworked File I/O lesson, featuring NIO.2. This functionality is part of JDK7, which is available now through the Open JDK project on java.net.
  • A new specialized trail covering Sockets Direct Protocol, also new in JDK7.
  • A new facility for gathering feedback about the tutorial. At the bottom of each tutorial page, under the "Discuss" heading, you can leave a publicly viewable, blog-style comment. Let us know what you think about the inclusion of this JS-Kit mechanism.

Thanks, as always, for your feedback. It helps us improve the tutorial!

-- Sharon Zakhour

Wednesday May 13, 2009

Watching A Directory for Changes — File Change Notification in NIO.2

The NIO.2 API can be used to write a program that watches a file or directory and notifies the application when the file has changed.[Read More]
About

Blog about Java technology documentation and news about Java releases.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today