The following example demonstrates using FileUtils.sizeofDirectory(File Name) of the File class to obtain the size of the directory:
/* author by w3cschool.cc Main.java */import java.io.File;import org.apache.commons.io.FileUtils;public class Main { public static void main(String[] args) { long size = FileUtils.sizeOfDirectory (new File("C:/test")); System.out.println("Size: " + size + " bytes"); }
The output result of running the above code is:
Size: 2048 bytes
The above is the Java example - Get the content of the directory size. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version
Useful JavaScript development tools