mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 14:19:53 +01:00
Removed Java 1.6 API call.
This commit is contained in:
@@ -9,8 +9,6 @@ import java.security.CodeSource;
|
|||||||
|
|
||||||
import org.apache.commons.io.FileSystemUtils;
|
import org.apache.commons.io.FileSystemUtils;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.StatFs;
|
import android.os.StatFs;
|
||||||
|
|
||||||
public class FileUtils {
|
public class FileUtils {
|
||||||
@@ -88,15 +86,10 @@ public class FileUtils {
|
|||||||
f.delete();
|
f.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
|
||||||
public static long getFreeSpace(File f) throws IOException {
|
public static long getFreeSpace(File f) throws IOException {
|
||||||
if(OsUtils.isAndroid()) {
|
if(OsUtils.isAndroid()) {
|
||||||
if(Build.VERSION.SDK_INT >= 9) {
|
StatFs s = new StatFs(f.getAbsolutePath());
|
||||||
return f.getUsableSpace();
|
return (long) s.getAvailableBlocks() * s.getBlockSize();
|
||||||
} else {
|
|
||||||
StatFs s = new StatFs(f.getAbsolutePath());
|
|
||||||
return (long) s.getAvailableBlocks() * s.getBlockSize();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return FileSystemUtils.freeSpaceKb(f.getAbsolutePath()) * 1024L;
|
return FileSystemUtils.freeSpaceKb(f.getAbsolutePath()) * 1024L;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user