<commit_before>package app.ddf.danskdatahistoriskforening.helper;

//http://developer.android.com/guide/topics/media/camera.html#saving-media

import android.content.Context;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;

import java.io.File;

import app.ddf.danskdatahistoriskforening.main.MainActivity;

public class LocalMediaStorage {
    public static final int MEDIA_TYPE_IMAGE = 1;
    public static final int MEDIA_TYPE_AUDIO = 2;
    public static final int MEDIA_TYPE_AUDIO_RECORD = 3;
    public static final int MEDIA_TYPE_AUDIO_RECORD_TEMP = 4;
    public static final int MEDIA_TYPE_AUDIO_RECORD_MERGED = 5;
    private static Context context;



    /** Create a file Uri for saving an image or video */
    public static Uri getOutputMediaFileUri(String filename, int type){
        File file = getOutputMediaFile(filename, type);
        return Uri.fromFile(file);
    }

    public static File getOutputMediaFile(String filename, int type){
        File folder = getOutputMediaFolder();
        if(folder == null)
            return null;
        File file = getOutputMediaFile(filename, type, folder);<commit_msg>fixed crash related to taking pictures with unmounted sd card<commit_after>package app.ddf.danskdatahistoriskforening.helper;

//http://developer.android.com/guide/topics/media/camera.html#saving-media

import android.content.Context;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;

import java.io.File;

import app.ddf.danskdatahistoriskforening.main.MainActivity;

public class LocalMediaStorage {
    public static final int MEDIA_TYPE_IMAGE = 1;
    public static final int MEDIA_TYPE_AUDIO = 2;
    public static final int MEDIA_TYPE_AUDIO_RECORD = 3;
    public static final int MEDIA_TYPE_AUDIO_RECORD_TEMP = 4;
    public static final int MEDIA_TYPE_AUDIO_RECORD_MERGED = 5;
    private static Context context;



    /** Create a file Uri for saving an image or video */
    public static Uri getOutputMediaFileUri(String filename, int type){
        File file = getOutputMediaFile(filename, type);
        if(file == null){
            return null;
        }
        return Uri.fromFile(file);
    }

    public static File getOutputMediaFile(String filename, int type){
        File folder = getOutputMediaFolder();
        if(folder == null)
            return null;
        File file = getOutputMediaFile(filename, type, folder);
{'fraction_non_alphanumeric': 0.07742728390004097, 'fraction_numerical': 0.004096681687832855, 'mean_word_length': 3.67816091954023, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6003419', 'n_tokens_mistral': 742, 'n_tokens_neox': 700, 'n_words': 200}