com.nivekaa.soko.util.FileUtil Maven / Gradle / Ivy
package com.nivekaa.soko.util;
import java.io.File;
/**
* @author nivekaa
* Created 22/03/2020 at 18:36
* Class com.nivekaa.soko.util.FileUtil
*/
public class FileUtil {
public static final double MAX_FILE_SIZE_UPLOAD_MB = 24.0;
public static double getFileSizeMegaBytes(long l) {
return (double) l / (1024 * 1024);
}
public static double getFileSizeKiloBytes(long l) {
return (double) l / 1024;
}
public static double getFileSizeBytes(long l) {
return l;
}
public static long filesSize(File[] files){
if (files==null)
return 0L;
long size = 0L;
for (int i = 0; i < files.length ; i++) {
size += files.length;
}
return size;
}
}