FileHelper { public static InputStreamReader openItemFile(Context context, Configuration.Item item) throws FileNotFoundException { if (item.location.startsWith("content: try { return new InputStreamReader(context.getContentResolver().openInputStream(Uri.parse(item.location))); } catch (SecurityException e) { Log.d("FileHelper", "openItemFile: Cannot open", e); throw new FileNotFoundException(e.getMessage()); } } else { File file = getItemFile(context, item); if (file == null) return null; if (item.isDownloadable()) return new InputStreamReader(new SingleWriterMultipleReaderFile(getItemFile(context, item)).openRead()); return new FileReader(getItemFile(context, item)); } }  static InputStream openRead(Context context, String filename); static OutputStream openWrite(Context context, String filename); static Configuration loadCurrentSettings(Context context); static Configuration loadPreviousSettings(Context context); static Configuration loadDefaultSettings(Context context); static void writeSettings(Context context, Configuration config); static File getItemFile(Context context, Configuration.Item item); static InputStreamReader openItemFile(Context context, Configuration.Item item); static int poll(StructPollfd[] fds, int timeout); static FileDescriptor closeOrWarn(FileDescriptor fd, String tag, String message); static T closeOrWarn(T fd, String tag, String message);  }
@Test public void testOpenItemFile() throws Exception { Configuration.Item item = new Configuration.Item(); item.location = "hexample.com"; assertNull(FileHelper.openItemFile(mockContext, item)); }