文件整理
This commit is contained in:
@ -134,9 +134,7 @@ public class FileUtils {
|
||||
@SuppressWarnings("deprecation")
|
||||
public static float getFreeSpaceByPath(String path) {
|
||||
StatFs statfs = new StatFs(path);
|
||||
|
||||
long blockSize = statfs.getBlockSize();
|
||||
|
||||
long availableBlocks = statfs.getAvailableBlocks();
|
||||
|
||||
return availableBlocks * blockSize / 1024f / 1024f;
|
||||
@ -168,8 +166,7 @@ public class FileUtils {
|
||||
DataInputStream dis = null;
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(url)
|
||||
.openConnection();
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
connection.setConnectTimeout(5 * 1000);
|
||||
connection.setReadTimeout(5 * 1000);
|
||||
|
||||
Reference in New Issue
Block a user