Java 7 New Features

java-thumbnail

As with every new Java version, Java 7 introduced some new features. The new features are definitely worth the change and as developers, we must be happy as we can be more efficient. There are many features introduced in Java 7 but we will look at some of them. Allows Strings to be used in […]

FileStore in Java 7

java-thumbnail

FileStore is new class introduced in Java 7.0. It is part of java.nio package. This class helps in geting the type of storage for the files stored whether it’s a device, partition or concreate file system. Also this class defines the list of methods which is useful for getting information about the file storage such […]

Reading file asynchronously in Java

java-thumbnail

We all are familiar with reading/writing file in a synchronous way. In Java 7 a new API was added to read/write the contents of the file asynchronously. The API is AsynchronousFileChannel. also read: Java 7.0 Tutorials New Features in Java 7.0 G1 Garbage Collector in Java 7.0 In this example lets look at how to […]

Visiting all the files and directories for a directory in Java using NIO2

java-thumbnail

At times we might want to search for some file in a directory traversing recursively into other directories with in that directory, I know getting the recursive program right at the first time is always a challenge. Or we might want to list all the contents of a directory. For all these operations the NIO2 […]

Listing and filtering directory content using Java NIO2

java-thumbnail

The Files class provides a method- newDirectoryStream to get the Directory contents for a give path instance. There are other overloaded versions of newDirectoryStream method which take in filters to apply on the directory content. also read: Java 7.0 Tutorials New Features in Java 7.0 G1 Garbage Collector in Java 7.0 Listing all files in […]

Creating Hard links and Soft links for a file in Java

java-thumbnail

We have been exploring the NIO enhancements in Java 7 and in this post I will explain about creating links- Hard links and Soft links in Java. And this feature is part of Java 7. also read: Java 7.0 Tutorials New Features in Java 7.0 G1 Garbage Collector in Java 7.0 A link is kind […]

Obtaining and modifying the metadata of the files in Java 7 NIO.2

java-thumbnail

Files usually contain information like its creation time, last modified time, last accessed time, size, type, permissions, ownership and other details which constitute its metadata. NIO.2 enhancements in Java 7 adds views to obtain metadata information of the file. The file attributes are grouped into different views based on their relatedness and applicability, for example […]

Exploring the Path API – Java NIO enhancement in Java 7

java-thumbnail

All of us know that an instance of File doesn’t indicate a file in the file system, unless some one invokes a create or related methods. But its a kind of confusion- you talk about instance of File and then you also talk about file at the disk level. A new class was introduced in […]

Creating, Writing, Reading files using Java Files API of Java 7

java-thumbnail

In our previous post we did get a taste of the power of the static APIs in the Java Files class and we managed to compare the code written without using the APIs in Java Files and with using the APIs in Java Files. also read: Java 7.0 Tutorials New Features in Java 7.0 G1 […]

A peek into the Files utility which is part of java.nio package in Java 7

java-thumbnail

We recently wrote about watching a directory using the new APIs introduced as part of Java 7. In this post let me throw some light on another class added to the java.nio package as part of Java 7 update- java.nio.file.Files. Another piece of information related to this is that complete java.nio.file package was added as […]

Close
Please support the site
By clicking any of these buttons you help our site to get better