J
J
JX2017-08-04 12:34:46
Java
JX, 2017-08-04 12:34:46

Java: how to check how much space is left on the disk where temporary files are stored?

Java: how to check how much space is left on the disk where temporary files are stored?
exactly in the folder with which the POI library is working class org.apache.poi.xssf.streaming.SXSSFWorkbook

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2017-08-04
@JX

File file = new File(System.getProperty("java.io.tmpdir"));
long freeSpace = file.getFreeSpace();

L
Labunsky, 2017-08-04
@Labunsky

stackoverflow

public static long getFreeSpace(String path) {
    File folder = new File(path);
    return folder.getFreeSpace();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question