update javadocs

This commit is contained in:
Hans-Christoph Steiner
2020-10-20 16:11:58 +02:00
parent c0344c1eed
commit 15a024b06e
2 changed files with 9 additions and 1 deletions

View File

@@ -1,8 +1,8 @@
package org.fdroid.fdroid;
import android.content.Context;
import androidx.annotation.Nullable;
import android.util.Log;
import androidx.annotation.Nullable;
import java.io.File;
import java.io.FileOutputStream;
@@ -16,6 +16,9 @@ public class AssetUtils {
private static final String TAG = "Utils";
/**
* This requires {@link Context} from {@link android.app.Instrumentation#getContext()}
*/
@Nullable
public static File copyAssetToDir(Context context, String assetName, File directory) {
File tempFile = null;
@@ -28,6 +31,7 @@ public class AssetUtils {
output = new FileOutputStream(tempFile);
Utils.copy(input, output);
} catch (IOException e) {
Log.e(TAG, "Check the context is from Instrumentation.getContext()");
fail(e.getMessage());
} finally {
Utils.closeQuietly(output);