@Test(expected = IllegalArgumentException.class) public void nullUriTest() { PodcastDirectoryHelper.getITunesId(null); }
public static String getITunesId(Uri uri) { if (uri == null) { throw new IllegalArgumentException("uri is null"); } String id = ""; List<String> segments = uri.getPathSegments(); for (int i = 0; segments != null && i < segments.size(); i++) { if (segments.get(i).startsWith("id")) { id = segments.get(i).replace("id", ""); break; } } return id; }
PodcastDirectoryHelper { public static String getITunesId(Uri uri) { if (uri == null) { throw new IllegalArgumentException("uri is null"); } String id = ""; List<String> segments = uri.getPathSegments(); for (int i = 0; segments != null && i < segments.size(); i++) { if (segments.get(i).startsWith("id")) { id = segments.get(i).replace("id", ""); break; } } return id; } }
PodcastDirectoryHelper { public static String getITunesId(Uri uri) { if (uri == null) { throw new IllegalArgumentException("uri is null"); } String id = ""; List<String> segments = uri.getPathSegments(); for (int i = 0; segments != null && i < segments.size(); i++) { if (segments.get(i).startsWith("id")) { id = segments.get(i).replace("id", ""); break; } } return id; }  }
PodcastDirectoryHelper { public static String getITunesId(Uri uri) { if (uri == null) { throw new IllegalArgumentException("uri is null"); } String id = ""; List<String> segments = uri.getPathSegments(); for (int i = 0; segments != null && i < segments.size(); i++) { if (segments.get(i).startsWith("id")) { id = segments.get(i).replace("id", ""); break; } } return id; }  static Channel getChannelFromITunesJson(String jsonStr); static String getDirectoryUrl(int directoryType, String directoryId); static boolean containsITunesHost(Uri uri); static String getITunesId(Uri uri); }
PodcastDirectoryHelper { public static String getITunesId(Uri uri) { if (uri == null) { throw new IllegalArgumentException("uri is null"); } String id = ""; List<String> segments = uri.getPathSegments(); for (int i = 0; segments != null && i < segments.size(); i++) { if (segments.get(i).startsWith("id")) { id = segments.get(i).replace("id", ""); break; } } return id; }  static Channel getChannelFromITunesJson(String jsonStr); static String getDirectoryUrl(int directoryType, String directoryId); static boolean containsITunesHost(Uri uri); static String getITunesId(Uri uri); static final int DIRECTORY_TYPE_ITUNES; }