Here you can find the source of getFileSize(File[] files)
Parameter | Description |
---|---|
files | a parameter |
public static long getFileSize(File[] files)
//package com.java2s; import java.io.File; public class Main { /**/*from w w w .j av a 2s.com*/ * Calculate the size of files * * @param files * @return */ public static long getFileSize(File[] files) { long num = 0L; for (File file : files) { if (file.isDirectory()) { num += getFileSize(file.listFiles()); } else { num += file.length(); } } return num; } }