+ // Backwards compatibility
+ final String text = CharStreams.toString(
+ CharStreams.newReaderSupplier(new InputSupplier<InputStream>() {
+ @Override
+ public InputStream getInput() throws IOException {
+ return source.openStream();
+ }
+ }, Charsets.UTF_8));
+
+ return ASTSchemaSource.create(source.getIdentifier().getName(), ctx, text);