Category: File

java tutorials

How to Calculate Folder Size in Java

Calculating the size of a folder or directory is trivial. In Java you can recursively traverse each folder and calculate the size of each file individually, and return the sum of all the files. You’ll...
java tutorials

How to Write text to File in Java

This tutorial show you how to write text to File using java. We can write text to a file in a couple of ways. First we explore the old way using a BufferedWriter. Next we...
java tutorials

How to Create a File in Java

This tutorial shows you how to create a file using java. First we explore the old way using the File class. Next we explore the new Path class introduced in Java 7. Create a File...