Home > Java Core (page 5)

Java Core

Unix epoch time to Java Date object

Java

What is epoch time? The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). Literally speaking the epoch is Unix time 0 (midnight 1/1/1970), but ‘epoch’ is often used as a synonym for ‘Unix time’. Many ... Read More »

Java Utility to Decompress a Zip File In Java

JavaIO

In the previous example we have seen “How to compress files/folder in java“. Now we will focus on “Java Utility to Decompress a Zip File In Java” Java provides “java.util.zip” library to compress files/folder in zip format. Steps to follow – 1. Take folder/files path as input. 2. Read the zip file using ZipInputStream 3. Get the zip file list ... Read More »

Java Utility To Compress Files/Folder In Zip Format

JavaIO

Java provides “java.util.zip” library to compress files/folder in zip format. Steps to follow – 1. Take folder/files path as input. 2. Create a ZipOutputStream 3. Check if folder is empty or not. If the folder is empty, we will simply add the empty folder in zip, else we will read all the files and will add every files to zip. ... Read More »