Package org.fcrepo.server.storage.translation

Examples of org.fcrepo.server.storage.translation.DOTranslator


                throw new IOException("FEDORA_HOME is not set. Try using -Dfedora.home=path/to/fedorahome");
            }
            in = new FileInputStream(new File(args[0]));
            Server server;
            server = Server.getInstance(new File(Constants.FEDORA_HOME));
            DOTranslator trans =
                    (DOTranslator) server
                            .getModule("org.fcrepo.server.storage.translation.DOTranslator");
            if (trans == null) {
                throw new IOException("DOTranslator module not found via getModule");
            }
            DigitalObject obj = new BasicDigitalObject();
            System.out.println("Deserializing...");
            trans.deserialize(in,
                              obj,
                              args[1],
                              args[2],
                              DOTranslationUtility.DESERIALIZE_INSTANCE);
            System.out.println("Done.");
            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            System.out.println("Re-serializing...");
            trans.serialize(obj,
                            outStream,
                            args[1],
                            args[2],
                            DOTranslationUtility.SERIALIZE_STORAGE_INTERNAL);
            System.out.println("Done. Here it is:");
View Full Code Here

TOP

Related Classes of org.fcrepo.server.storage.translation.DOTranslator

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.