// Path: igcParser/src/main/java/com/shollmann/android/igcparser/util/Logger.java
// public class Logger {
// 
//     public static void log(String s) {
//         if (BuildConfig.DEBUG) {
//             Log.d("IGCParser :: ", s);
//         }
//     }
// 
//     public static void logError(String s) {
//         if (BuildConfig.DEBUG) {
//             Log.e("IGCParser :: ", s);
//         }
//     }
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import android.content.Context;
import android.net.Uri;
import android.support.annotation.Nullable;
import com.shollmann.android.igcparser.util.Logger;
            } else {
                is = new FileInputStream(fileToCopyPath);
            }

            try {
                file = new File(context.getCacheDir(), tempFileName);
                OutputStream output = new FileOutputStream(file);
                try {
                    byte[] buffer = new byte[4 * 1024]; // or other buffer size
                    int read;

                    while ((read = is.read(buffer)) != -1) {
                        output.write(buffer, 0, read);
                    }
                    output.flush();
                } finally {
                    output.close();
                }

            } finally {
                is.close();
            }
        } catch (Throwable t) {
            Logger.logError("FileUtilities :: Error trying copy file to temp folder");
        } finally {
            try {
                if (is != null) {
                    is.close();
                }
            } catch (Throwable t) {
// Path: igcParser/src/main/java/com/shollmann/android/igcparser/util/Logger.java
// public class Logger {
// 
//     public static void log(String s) {
//         if (BuildConfig.DEBUG) {
//             Log.d("IGCParser :: ", s);
//         }
//     }
// 
//     public static void logError(String s) {
//         if (BuildConfig.DEBUG) {
//             Log.e("IGCParser :: ", s);
//         }
//     }
// }


// Path: app/src/main/java/com/shollmann/igcparser/util/FileUtilities.java
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import android.content.Context;
import android.net.Uri;
import android.support.annotation.Nullable;
import com.shollmann.android.igcparser.util.Logger;

            } else {
                is = new FileInputStream(fileToCopyPath);
            }

            try {
                file = new File(context.getCacheDir(), tempFileName);
                OutputStream output = new FileOutputStream(file);
                try {
                    byte[] buffer = new byte[4 * 1024]; // or other buffer size
                    int read;

                    while ((read = is.read(buffer)) != -1) {
                        output.write(buffer, 0, read);
                    }
                    output.flush();
                } finally {
                    output.close();
                }

            } finally {
                is.close();
            }
        } catch (Throwable t) {
            Logger.logError("FileUtilities :: Error trying copy file to temp folder");
        } finally {
            try {
                if (is != null) {
                    is.close();
                }
            } catch (Throwable t) {
                Logger.logError("FileUtilities :: Error trying to close input stream");