Java IO

Category Archives: Java IO

How to Write XLS and XLSX File in Java – Apach POI Example

In this tutorial, You will see How can you write the XLS or XLSX files in Java using Apache POI. Java doesn’t provide direct API to read and write Excel document, you have to rely on third party libraries. In the last article, We have seen How to read .xls or .xlsx file in java. To … Continue reading How to Write XLS and XLSX File in Java – Apach POI Example

Read Excel file using Java – Apach POI

Let’s see how can you Read Excel file using Java using Apache POI. Java doesn’t provide direct API to read and write Excel document, you have to rely on third party libraries. To read and write XLS or XLSX file you can use JXL open source library or Apache POI library. I will suggest to … Continue reading Read Excel file using Java – Apach POI

Make file Read Only in Java

To make file Read Only in Java, we use setReadOnly() method of the java.io.File package. Since JDK 1.6, a new setWritable() method is provided to make a file be writable again. We can also check whether the file is writable or read-only using the canWrite() method. We will see the whole process in the below-mentioned example. We will see, how … Continue reading Make file Read Only in Java

Get Last Modified Date of File in Java

Let’s see How can you get last modified date of File in Java. Sometimes we need to get the file last modified date in java usually, for listeners like JBoss config file changes hot deployment. To get the last modified date, you can use the File.lastModified() to get the file’s last modified timestamps. This method will return the … Continue reading Get Last Modified Date of File in Java

Read Data From Console in Java

In the tutorials we will see, How can we read data from the console in Java. There are many ways to read data from the keyboard. For example: InputStreamReader Console Scanner Java InputStreamReader class can be used to read data from the keyboard. It converts the byte-oriented stream into the character-oriented stream. We have already seen … Continue reading Read Data From Console in Java

Sequence InputStream in Java

Java SequenceInputStream class is used to read data from multiple streams or we can say SequenceInputStream is used to copy a number of source files to one destination file. Many input streams are concatenated and converted into a single stream and copied at a stretch to the destination file. SequenceInputStream contains two constructor – SequenceInputStream(file f1, … Continue reading Sequence InputStream in Java