Course description
Java SE 7 platform gave us a brand new file based I/O architecture, NIO2. This new architecture solved most of the problems we saw in the original stream based I/O. You’ll see how the NIO2 Path class is used to represent the underlying file system syntax, in a manner that is transparent to the application. Next you’ll see how the NIO2 Files class works with the Path class. Then we’ll cover the new NIO2 asynchronous channels, to let us monitor and control the completion of our asynchronous events. NIO2 also gives us a new asynchronousChannelGroup to group these channels, and supply them with a pool of threads for resource sharing. And we’ll take a look at the new WatchService file change notification API, which lets you register to be notified when files or directories change on the file system. After our tour of NIO2, we’ll move to the new networking features provided by Java SE 7. We’ll experiment with the URLClassLoader, which now implements the Closable I/F and its close() method. Then we’ll take a look at the new protocols we can now access. One is the Stream Control Transmission Protocol, or SCTP, and another new protocol is Sockets Direct Protocol, or SDP.
Prerequisites
This course assumes that the users have a solid understanding object-oriented principals and experience coding with Java 5 or greater. This course was filmed using Eclipse for RCP and RAP developers (Java developer edition). A general understanding of Eclipse is required but only to understand the methods shown. The theory for this course will work on any IDE that supports the Java 7 SE SDK. You should have view the course ‘Java 7 SE: Enhancements and Concurrency’ before viewing this course.
Learning Paths
This course will help you prepare for the following certification and exam:
Java SE 7 Programmer I
1Z0-803: Java SE 7 Programmer I
This course is part of the following LearnNowOnline SuccessPaths™:
Java Development
Meet the expert
Brigitte Birze is a seasoned software development professional with over 25 years of experience in Corporate IT and Engineering across many verticals. Brigitte has been involved in every phase of the software development lifecycle from the perspective of several roles: individual contributor, team lead, S/W architect, system engineer, proposal author, and project manager. Her innovative software architectures have resulted in six published papers and eight patents. Brigitte's dynamic communication skills, paired with her depth and breadth of technical knowledge, give her the unique ability to make the complex understandable and to convey technical concepts to cross-functional groups, speaking at the business or technical level.
Course outline
IO and New IO
Java Stream Based File (21:17)
- Introduction (00:36)
- Java File I/O Issues (02:28)
- Java SE 6 File I/O and NIO (01:11)
- NIO2: Non-Blocking IO 2 (02:23)
- NIO Path and Path Classes (02:57)
- Demo: Paths (05:53)
- Demo: NIO (05:17)
- Summary (00:28)
NIO Files Class (19:07)
- Introduction (00:39)
- NIO File Class (01:20)
- NIO File Operations (01:10)
- Demo: Create Directories & Files (03:49)
- Demo: Managing Metadata (03:41)
- Windows ACL File Attributes (02:06)
- Demo: ACL File Attributes (01:39)
- Demo: New Directory ACL (03:58)
- Summary (00:42)
NIO File System Operations (09:27)
- Introduction (00:30)
- NIO File System Operations (02:18)
- Demo: File System Operations (03:57)
- Demo: DeleteIfExists (02:20)
- Summary (00:20)
Files, Async, Change
NIO Walking the Dir Tree (13:48)
- Introduction (00:31)
- NIO Walking the Dir Tree (02:19)
- Demo: Walk Tree (04:52)
- Demo: Copy Tree (05:35)
- Summary (00:29)
Finding Files With NIO (15:14)
- Introduction (00:34)
- Finding Files with NIO2 (02:03)
- NIO File Glob Arguments (04:51)
- Demo: Pattern Matching (03:27)
- Demo: Glob Patterns (03:45)
- Summary (00:31)
NIO Async Operations (11:23)
- Introduction (00:31)
- NIO Architecture (03:04)
- NIO2 Asynchronous Channels (02:40)
- Demo: Asynchronous Operations (04:35)
- Summary (00:31)
NIO Async Channel Group (08:03)
- Introduction (00:33)
- NIO Async Channel Group (02:39)
- Demo: Async Channel Group (04:21)
- Summary (00:29)
NIO Change Notification (11:46)
- Introduction (00:37)
- NIO File Change Notification (02:06)
- Demo: WatchService (03:17)
- Demo: WatchEvent (05:13)
- Summary (00:31)
Network Protocols
Network Protocols (10:36)
- Introduction (00:36)
- Java SE 7: New Networking (01:56)
- URLClassLoader.close() Method (02:20)
- Demo: URLClassLoader (05:15)
- Summary (00:27)
SCTP (11:09)
- Introduction (00:24)
- SCTP (01:43)
- SCTP NIO Channels (02:26)
- SCTP Server Open Channel (01:36)
- SCTP Server Accept Client Msg (01:22)
- SCTP Server Respond to Client (01:12)
- SCTP Client, Connect to Server (01:07)
- SCTP Client, Send Message (00:43)
- Summary (00:33)
SDP (06:54)
- Introduction (00:31)
- SDP (Sockets Direct Protocol) (01:43)
- Using SDP (02:06)
- Invoking an SDP Application (01:59)
- Summary (00:33)