We use winrar or winzip to unzip files in windows. I once wondered if I could write a java program to unpack .zip files and java.util.zip package was my answer. This core package of java is used to unzip (unpack or open) compressed files in ZIP formats.
java.io.FileFilter is used to list specific type of files in a directory in Java. FileFilter is an interface found in java.io package that filters files depending on the file extension provided.
We are all aware of the most simple way of copying a single file or a complicated folder structure from one location to another in WINDOWS- just a 2 click job or Ctrl C & Ctrl V. Is there is a simple way to do in Java as well? Let's find out.....
A folder can be deleted with a simple command in java programming.
File.delete();
But sometimes, When a folder contains files or sub folders, this method does not work. Join me if you want to know how this problem can be sorted effectivley.
One of the common problems we always hit is the File IO. This article quickly takes you through the very simple steps involved in how to read from a character based file (text file) and display its contents using your Java code with a working example that you can download.