mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 18:28:59 +03:00
io: Added IO helper class.
Contains static helper method to close Closable objects.
This commit is contained in:
parent
174df6e7a2
commit
cd065887dd
1 changed files with 24 additions and 0 deletions
24
src/main/java/com/owncloud/android/utils/IOHelper.java
Normal file
24
src/main/java/com/owncloud/android/utils/IOHelper.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
package com.owncloud.android.utils;
|
||||
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Static system IO helper methods
|
||||
*/
|
||||
|
||||
public class IOHelper {
|
||||
private static final String TAG = IOHelper.class.getSimpleName();
|
||||
|
||||
public static void close(Closeable c) {
|
||||
if (c == null) return;
|
||||
try {
|
||||
c.close();
|
||||
} catch (IOException e) {
|
||||
Log_OC.e(TAG, "Error closing stream", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue