Package com.xmlcalabash.io.DataStore

Examples of com.xmlcalabash.io.DataStore.DataWriter


        String href = getOption(_href).getString();
        String base = getOption(_href).getBaseURI().toASCIIString();

        try {
            DataStore store = runtime.getDataStore();
            URI id = store.writeEntry(href, base, contentType, new DataWriter() {
                public void store(OutputStream out) throws IOException {
                    try {
                        provider.format(source.read(),out,contentType);
                    } catch(SaxonApiException e) {
                        throw new IOException(e);
View Full Code Here


                serializer.setOutputStream(System.out);
                S9apiUtils.serialize(runtime, doc, serializer);
            } else {
                try {
                  DataStore store = runtime.getDataStore();
                  store.writeEntry(uri, uri, media, new DataWriter() {
            public void store(OutputStream ostream)
                throws IOException {
                          logger.trace("Attempt to write file: " + uri);
                          serializer.setOutputStream(ostream);
                          try {
View Full Code Here

                        // file already exists
                        tree.addText(id.toASCIIString());
                    }
                });
            } catch (FileNotFoundException e) {
                URI uri = store.writeEntry(href.getString(), base, "text/plain", new DataWriter() {
                    public void store(OutputStream content) throws IOException {
                        // empty file
                    }
                });
                tree.addText(uri.toASCIIString());
View Full Code Here

TOP

Related Classes of com.xmlcalabash.io.DataStore.DataWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.