pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/Blankj/AndroidUtilCode/pull/1750/files

all" rel="stylesheet" href="https://github.githubassets.com/assets/github-cf976967feea1e66.css" /> StatFs should catch IllegalArgumentException in case the specified pa… by lancewoo · Pull Request #1750 · Blankj/AndroidUtilCode · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions lib/utilcode/src/main/java/com/blankj/utilcode/util/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,13 @@ public static void notifySystemToScan(final File file) {
*/
public static long getFsTotalSize(String anyPathInFs) {
if (TextUtils.isEmpty(anyPathInFs)) return 0;
StatFs statFs = new StatFs(anyPathInFs);
StatFs statFs;
try {
statFs = new StatFs(anyPathInFs);
} catch (IllegalArgumentException e) {
e.printStackTrace();
return 0;
}
long blockSize;
long totalSize;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
Expand All @@ -1433,7 +1439,13 @@ public static long getFsTotalSize(String anyPathInFs) {
*/
public static long getFsAvailableSize(final String anyPathInFs) {
if (TextUtils.isEmpty(anyPathInFs)) return 0;
StatFs statFs = new StatFs(anyPathInFs);
StatFs statFs;
try {
statFs = new StatFs(anyPathInFs);
} catch (IllegalArgumentException e) {
e.printStackTrace();
return 0;
}
long blockSize;
long availableSize;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public static List<SDCardInfo> getSDCardInfo() {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
} else {
try {
Expand Down Expand Up @@ -101,6 +103,8 @@ public static List<SDCardInfo> getSDCardInfo() {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
}
return paths;
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy