I'm having writing a JSON to file to be accessed, as to eliminate as much network access/delay from my app. I haven't dealt with writing files to memory before, and took the majority of the read/write code from Google's documentation, but I am still having issues. 

Currently, I'm getting a null pointer exception at this line:

```
FileOutputStream fOut = openFileOutput("runesInfo.json", Context.MODE_PRIVATE)

```

This makes me believe that the file is never created, or that I am initializing it wrong, but I am not sure how. 

The full code section:

```
public class GetRunes extends AsyncTask<String, String, String> {

        boolean runesCached = false;

        protected String doInBackground(String[] runeId) {
            String url = "https://prod.api.pvp.net/api/lol/static-data/" + region + "/v1.2/rune?api_key=" + api_key;
            JSONParser jsonParser = new JSONParser();
            JSONObject runeInfo = jsonParser.getJSONFromUrl(url);
            String jsonString = runeInfo.toString();
            String readJson = null;
            Context context = GetStaticData.this;

            if(!runesCached) {
                Log.d("Cache", "Caching File");

                try {
                    File file = new File(context.getFilesDir(), "runesInfo.json");
                    FileOutputStream fOut = openFileOutput("runesInfo.json", Context.MODE_PRIVATE);
                    fOut.write(jsonString.getBytes());
                    fOut.close();
                    Log.d("Cache", "Cache Complete");
                    runesCached = true;

                } catch (Exception e){
                    e.printStackTrace();
                }

            }

            String name = null;
            try {
                FileInputStream fis = openFileInput("runesInfo.json");
                InputStreamReader isr = new InputStreamReader(fis);

                fis.read(readJson.getBytes());
                JSONObject storedJson = new JSONObject(readJson);
                Log.d("Stored JSON", "" + storedJson);
                JSONObject idJson = storedJson.getJSONObject("data");
                JSONObject single = idJson.getJSONObject(runeId[0]);

                try {
                    name = single.getString("name");
                } catch (JSONException e) {
                    e.printStackTrace();
                }

            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (StreamCorruptedException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (JSONException e) {
                e.printStackTrace();
            }
            return name;
        }
    }

```

Logcat:

```
04-29 09:53:58.199  11273-11732/edu.appdesign.leaguestats D/Cache﹕ Caching File
04-29 09:53:58.199  11273-11732/edu.appdesign.leaguestats W/System.err﹕ java.lang.NullPointerException
04-29 09:53:58.199  11273-11732/edu.appdesign.leaguestats W/System.err﹕ at android.content.ContextWrapper.getFilesDir(ContextWrapper.java)
04-29 09:53:58.199  11273-11732/edu.appdesign.leaguestats W/System.err﹕ at edu.appdesign.leaguestats.GetStaticData$GetRunes.doInBackground(GetSt
04-29 09:53:58.199  11273-11732/edu.appdesign.leaguestats W/System.err﹕ at edu.appdesign.leaguestats.GetStaticData$GetRunes.doInBackground(GetSt
04-29 09:53:58.199  11273-11732/edu.appdesign.leaguestats W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java)
04-29 09:53:58.199  11273-11732/edu.appdesign.leaguestats W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java)
04-29 09:53:58.199  11273-11732/edu.appdesign.leaguestats W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java)
04-29 09:53:58.209  11273-11732/edu.appdesign.leaguestats W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
04-29 09:53:58.209  11273-11732/edu.appdesign.leaguestats W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
04-29 09:53:58.209  11273-11732/edu.appdesign.leaguestats W/System.err﹕ at java.lang.Thread.run(Thread.java)
04-29 09:53:58.209  11273-11273/edu.appdesign.leaguestats W/System.err﹕ java.util.concurrent.ExecutionException: java.lang.NullPointerException
04-29 09:53:58.209  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at java.util.concurrent.FutureTask.report(FutureTask.java)
04-29 09:53:58.209  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at java.util.concurrent.FutureTask.get(FutureTask.java)
04-29 09:53:58.209  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at android.os.AsyncTask.get(AsyncTask.java)
04-29 09:53:58.209  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at edu.appdesign.leaguestats.GetStaticData.getRuneInfo(GetStaticData.jav
04-29 09:53:58.209  11273-11732/edu.appdesign.leaguestats W/dalvikvm﹕ threadid=20: thread exiting with uncaught exception (group=0x41650e18)
04-29 09:53:58.209  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at edu.appdesign.leaguestats.RunesActivity$GetRunes.onPostExecute(RunesA
04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at edu.appdesign.leaguestats.RunesActivity$GetRunes.onPostExecute(RunesA
04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at android.os.AsyncTask.finish(AsyncTask.java)
04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at android.os.AsyncTask.access$600(AsyncTask.java)
04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java)
04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java)
04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at android.os.Looper.loop(Looper.java)
04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java)
04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)

04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java)
04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit
04-29 09:53:58.219  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
04-29 09:53:58.229  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:133)
04-29 09:53:58.229  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
04-29 09:53:58.229  11273-11273/edu.appdesign.leaguestats W/System.err﹕ Caused by: java.lang.NullPointerException
04-29 09:53:58.229  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at android.content.ContextWrapper.openFileInput(ContextWrapper.java)
04-29 09:53:58.229  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at edu.appdesign.leaguestats.GetStaticData$GetRunes.doInBackground(GetSt
04-29 09:53:58.229  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at edu.appdesign.leaguestats.GetStaticData$GetRunes.doInBackground(GetSt
04-29 09:53:58.229  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java)
04-29 09:53:58.229  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java)
04-29 09:53:58.229  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java)
04-29 09:53:58.229  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
04-29 09:53:58.239  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
04-29 09:53:58.239  11273-11273/edu.appdesign.leaguestats W/System.err﹕ at java.lang.Thread.run(Thread.java)

```