Top Posts in Python
Java Zip File Folder Example
Today we will look into java zip file example. We will also compress a folder and create zip file using java program. Java ZIP java.util.zip.ZipOutputStream can be used to compress a file into ZIP format…..
Java IO Tutorial
Java provides several classes in java.io package to work with text, stream data, and file system. I have provided several examples on Java Files and Java IO recently. This post is an index of all….
How to Compile and Run Java Program from another Java Program
Have you ever thought if it’s possible to compile and run a java program from another java program? We can use Runtime.exec(String cmd) to issue commands to the underlying operating system. We will use the….
ObjectInputStream in Java – read Object from File
ObjectInputStream in Java can be used to convert InputStream to object. The process of converting the input stream to an object is called deserialization. In last post, we learned about ObjectOutputStream and converted java object….
ObjectOutputStream in Java – write Object to File
ObjectOutputStream in Java can be used to convert an object to OutputStream. The process of converting object to stream is called serialization in java. Once an object is converted to Output Stream, it can be….
Java Download File from URL
Today we will learn how to download a file from URL in java. We can use java.net.URL openStream() method to download file from URL in java program. We can use Java NIO Channels or Java….
Java RandomAccessFile Example
Java RandomAccessFile provides the facility to read and write data to a file. RandomAccessFile works with file as large array of bytes stored in the file system and a cursor using which we can move….
Java InputStream to File Example
Files can be read using Reader or Stream in java. The Reader is good to use for text data but to work with binary data you should use Stream. FileInputStream is used to open the….
How to get File last modified date in Java
Sometimes we need to get the file last modified date in Java, usually for listeners like JBoss config file changes hot deployment. java.io.File class lastModified() returns last modified date in long, we can construct date….
How to Check if File exists in Java
java.io.File class exists() method can be used to check if file exists or not in java. If file exists, it returns true else this method returns false. Java Check if File Exists Let’s look at….