All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nivekaa.soko.util.FileUtil Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy