Java 7 new features cookbook / Richard M. Reese, Jennifer L. Reese
- Author
- Reese, Richard M., 1953-
- Published
- Birmingham : Packt Pub., 2012.
- Physical Description
- 1 online resource (384 pages) : illustrations
- Additional Creators
- Reese, Jennifer L.
Access Online
- Contents
- 1. Java Language Improvements -- 2. Locating Files and Directories Using Paths -- 3. Obtaining File and Directory Information -- 4. Managing Files and Directories -- 5. Managing Filesystems -- 6. Stream IO in Java 7 -- 7. Graphical User Interface Improvements -- 8. Handling Events -- 9. Database, Security, and System Enhancements -- 10. Concurrent Processing -- 11. Odds and Ends., 1. Java Language Improvements -- Introduction -- Using string literals in switch statements -- Using underscores in literals to improve code readability -- Using the try-with-resources block to improve exception handling code -- Creating a resource that can be used with the try-with-resources technique -- Catching multiple exception types to improve type checking -- Rethrowing exceptions in Java 7 -- Using the diamond operator for constructor type inference -- Using the @SafeVarargs annotation -- 2. Locating Files and Directories Using Paths -- Introduction -- Creating a Path object -- Interoperability between java.io. File and java.nio.file. Files -- Converting a relative path into an absolute path -- Removing redundancies by normalizing a path -- Combining paths using path resolution -- Creating a path between two locations -- Converting between path types -- Determining whether two paths are equivalent -- Managing symbolic links -- 3. Obtaining File and Directory Information -- Introduction -- Determining the file content type -- Obtaining a single attribute at a time using the getAttribute method -- Obtaining a map of file attributes -- Getting file and directory information -- Determining operating system support for attribute views -- Maintaining basic file attributes using the BasicFileAttributeView -- Maintaining POSIX file attributes using the PosixFileAttributeView -- Maintaining FAT table attributes using the DosFileAttributeView -- Maintaining file ownership attributes using the FileOwnerAttributeView -- Maintaining a file's ACL using the AclFileAttributeView -- Maintaining user-defined file attributes using the UserDefinedFileAttributeView -- 4. Managing Files and Directories -- Introduction -- Creating files and directories -- Controlling how a file is copied -- Managing temporary files and directories -- Setting time-related attributes of a file or directory -- Managing file ownership -- Managing ACL file permissions -- Managing POSIX attributes -- Moving a file and a directory -- Deleting files or directories -- Managing symbolic links -- 5. Managing Filesystems -- Introduction -- Getting FileStore information -- Getting Filesystem information -- Using the SimpleFileVisitor class to traverse filesystems -- Deleting a directory using the SimpleFileVisitor class -- Copying a directory using the SimpleFileVisitor class -- Processing the contents of a directory by using the DirectoryStream interface -- Filtering a directory using globbing -- Writing your own directory filter -- Monitoring file events using WatchEvents -- Understanding the ZIP filesystem provider -- 6. Stream IO in Java 7 -- Introduction -- Managing simple files -- Using buffered IO for files -- Random access IO using the SeekableByteChannel -- Managing asynchronous communication using the AsynchronousServerSocketChannel class -- Writing to a file using the AsynchronousFileChannel class -- Reading from a file using the AsynchronousFileChannel class -- Using the SecureDirectoryStream class., and 7. Graphical User Interface Improvements -- Introduction -- Mixing heavyweight and lightweight components -- Managing window types -- Managing the opacity of a window -- Creating a varying gradient translucent window -- Managing the shape of a window -- Using the new border types in Java 7 -- Handling multiple file selection in the FileDialog class -- Controlling the print dialog box type -- Using the new JLayer decorator for a password field -- 8. Handling Events -- Introduction -- Managing extra mouse buttons and high resolution mouse wheels -- Controlling a focus when displaying a window -- Using secondary loops to mimic modal dialog boxes -- Handling spurious thread wakeups -- Handling applet initialization status with event handlers -- 9. Database, Security, and System Enhancements -- Introduction -- Using the RowSetFactory class -- Java 7 database enhancements -- Using the ExtendedSSLSession interface -- Using the platform MXBeans for JVM or system process load monitoring -- Redirecting input and output from operating system's processes -- Embedding a JNLP file in an HTML page -- 10. Concurrent Processing -- Introduction -- Using join/fork framework in Java -- Using the reusable synchronization barrier Phaser -- Using the new ConcurrentLinkedDeque safely with multiple threads -- Using the new LinkedTransferQueue class -- Supporting multiple threads using the ThreadLocalRandom class -- 11. Odds and Ends -- Introduction -- Handling weeks in Java 7 -- Using the Currency class in Java 7 -- Using the NumericShaper. Range enumeration to support the display of digits -- JavaBean enhancements in Java 7 -- Handling locales and the Locale. Builder class in Java 7 -- Handling null references -- Using the new BitSet methods in Java 7.
- Summary
- Annotation Java 7 is a major update that includes a lot of exciting new language improvements such as support for type inference and improved exception handling. Other new features include the ability to work with symbolic links, a greatly simplified directory traversal technique, and the monitoring of file creation and deletion. Improvements in event handling, security, and concurrent processing have also been addedJava 7 New Features Cookbook is your go-to guide to learn about all the new exciting features Java 7 has to offer with a very practical recipe-based approach. The book starts with coverage of the new language improvements. Subsequent chapters address the new features of Java 7 while incorporating these new language improvements when possible. The new NIO techniques provide enhanced capabilities which are complemented by the new try-with-resources block and enhanced generic support. The new JLayer decorator and improved window methods enhance the developers ability to create GUI applications. The Java 7 New Features Cookbook provides a comprehensive coverage of the exciting features in Java 7.
- Subject(s)
- Genre(s)
- ISBN
- 9781849685634 (electronic bk.)
1849685630 (electronic bk.)
9781621989158 (electronic bk.)
1621989151 (electronic bk.)
1849685622
9781849685627 - Digital File Characteristics
- text file
View MARC record | catkey: 39314171