/** * Returns a read-only FileMeta from the input source * * @param text text data * @param meta meta data * @param factory factory * @param <T> resource type * * @return content */ public static <T extends ContentMeta> T withText(String text, Map<String, String> meta, ContentFactory<T> factory) { return factory.create(lazyStream(new ByteArrayInputStream(text.getBytes())), meta); }
/** * Returns a read-only FileMeta from the input source * * @param source data * @param meta meta data * @param factory factory * @param <T> resource type * * @return content */ public static <T extends ContentMeta> T withStream(InputStream source, Map<String, String> meta, ContentFactory<T> factory) { return factory.create(lazyStream(source), meta); }