/** * Reads the resource from a {@link Bundle}. * * @param resourcePath * The path to the resource. * @param bundle * The bundle to read from. * @return strings delimited by newline in the stream or empty set, on any exception. */ public static ImmutableSet<String> stringsForResourceInBundle(String resourcePath, Bundle bundle) { checkNotNull(resourcePath, "resourcePath"); checkNotNull(bundle, "bundle"); URL resource = bundle.getEntry(resourcePath); if (resource == null) return ImmutableSet.of(); try { return ImmutableSet.copyOf(splitOrEmptyAndClose(resource.openStream())); } catch (IOException e) { } catch (RuntimeException ex) { } return ImmutableSet.of(); }
/** * Reads the resource from a {@link Bundle}. * * @param resourcePath * The path to the resource. * @param bundle * The bundle to read from. * @return strings delimited by newline in the stream or empty set, on any exception. */ public static ImmutableSet<String> stringsForResourceInBundle(String resourcePath, Bundle bundle) { checkNotNull(resourcePath, "resourcePath"); checkNotNull(bundle, "bundle"); URL resource = bundle.getEntry(resourcePath); if (resource == null) return ImmutableSet.of(); try { return ImmutableSet.copyOf(splitOrEmptyAndClose(resource.openStream())); } catch (IOException e) { } catch (RuntimeException ex) { } return ImmutableSet.of(); }
/** * Reads the resource from a {@link Bundle}. * * @param resourcePath * The path to the resource. * @param bundle * The bundle to read from. * @return strings delimited by newline in the stream or empty set, on any exception. */ public static ImmutableSet<String> stringsForResourceInBundle(String resourcePath, Bundle bundle) { checkNotNull(resourcePath, "resourcePath"); checkNotNull(bundle, "bundle"); URL resource = bundle.getEntry(resourcePath); if (resource == null) return ImmutableSet.of(); try { return ImmutableSet.copyOf(splitOrEmptyAndClose(resource.openStream())); } catch (IOException e) { } catch (RuntimeException ex) { } return ImmutableSet.of(); }
/** * Reads the resource from a {@link Bundle}. * * @param resourcePath * The path to the resource. * @param bundle * The bundle to read from. * @return strings delimited by newline in the stream or empty set, on any exception. */ public static ImmutableSet<String> stringsForResourceInBundle(String resourcePath, Bundle bundle) { checkNotNull(resourcePath, "resourcePath"); checkNotNull(bundle, "bundle"); URL resource = bundle.getEntry(resourcePath); if (resource == null) return ImmutableSet.of(); try { return ImmutableSet.copyOf(splitOrEmptyAndClose(resource.openStream())); } catch (IOException e) { } catch (RuntimeException ex) { } return ImmutableSet.of(); }
/** * Reads the resource from a {@link Bundle}. * * @param resourcePath * The path to the resource. * @param bundle * The bundle to read from. * @return strings delimited by newline in the stream or empty set, on any exception. */ public static ImmutableSet<String> stringsForResourceInBundle(String resourcePath, Bundle bundle) { checkNotNull(resourcePath, "resourcePath"); checkNotNull(bundle, "bundle"); URL resource = bundle.getEntry(resourcePath); if (resource == null) return ImmutableSet.of(); try { return ImmutableSet.copyOf(splitOrEmptyAndClose(resource.openStream())); } catch (IOException e) { } catch (RuntimeException ex) { } return ImmutableSet.of(); }
/** * Reads the resource from a {@link Bundle}. * * @param resourcePath * The path to the resource. * @param bundle * The bundle to read from. * @return strings delimited by newline in the stream or empty set, on any exception. */ public static ImmutableSet<String> stringsForResourceInBundle(String resourcePath, Bundle bundle) { checkNotNull(resourcePath, "resourcePath"); checkNotNull(bundle, "bundle"); URL resource = bundle.getEntry(resourcePath); if (resource == null) return ImmutableSet.of(); try { return ImmutableSet.copyOf(splitOrEmptyAndClose(resource.openStream())); } catch (IOException e) { } catch (RuntimeException ex) { } return ImmutableSet.of(); }