All posts by Umesh

Zipping and Unzipping in Java

Zipping and Unzipping in Java In this post, we will learn Zipping and Unzipping in Java using java.util.zip API. We will also discuss some third-party API to perform these tasks.  1.  Zip a File We will be performing a simple operation to zip a single file into an archive. public class ZipSingleFile { public static void main(String[] […]

Continue reading

Collection Factory Methods in Java 9

Collection Factory Methods in Java 9 In this post, we will explore Collection Factory Methods in Java 9. Java 9 introduced a new Convenience Factory Methods for Collections.   Introduction Creating a new unmodifiable list in Java (before Java 9) is not very clean. Creating a small immutable collection in Java involves following steps Create collection. […]

Continue reading

Java nio2

Introduction to Java NIO2 This post is aiming to provide a high-level overview of the Java NIO2 API features. Java7 introduced a rich set of features to operators on the Files using Java NIO2 package. In this post, we will learn about some of the basic features introduced by Java Nio2. The java.nio.file package provides a comprehensive support […]

Continue reading

Java NIO Path

Java7 Introduced NIO2 as an enhancement to the current File API. Java NIO Path and especially Path class was one of the main entry points for NIO2 API. Path class is a representation of the underlying platform file system.Path class will create a path based on the platform you are working on. (e.g. For Linux […]

Continue reading

How to Move a File in Java

In this post, we will learn how to move a file in Java using Java7 NIO or Apache Commons IO. As part of the core java tutorials, we will cover following options. Move a file or directory using NIO and JDK 7. Move files or directory using Apache Commons IO.   1. Using JDK7 NIO Package […]

Continue reading