Package org.jitterbit.util.persist

Examples of org.jitterbit.util.persist.XmlPersistor.store()


    }

    private void persist(DriverDescriptor driver, File file) throws Exception {
        XmlPersistor p = XmlPersistor.newRoot("Driver");
        DriverDescriptorPersistor.persist(driver, p);
        p.store(file);
    }

    private void testPersistOdbc() throws Exception {
        BeginEndQuote quotes = new BeginEndQuote("\"");
        DriverDescriptor driver = OdbcDriverDescriptorFactory.createDescriptor("Postgresql", quotes);
View Full Code Here


            XmlPersistor persistor = XmlPersistor.newRoot("Drivers");
            for (DriverDescriptor d : driverDescriptors) {
                Persistor driverPersistor = persistor.createChild("Driver");
                DriverDescriptorPersistor.persist(d, driverPersistor);
            }
            persistor.store(file);
        } catch (Exception ex) {
            throw new DataCacheException(DatabaseMessages.getString("DatabaseDriverCache.StoringError"), ex);
        }
    }
View Full Code Here

            for (SortedSet<Entry> entries : backups.values()) {
                for (Entry e : entries) {
                    writeEntry(xml, e);
                }
            }
            xml.store(logFile);
        } catch (IOException ex) {
            ErrorLog.log(BackupLog.class, "Failed to update the project backup log file", ex);
        }
    }
View Full Code Here

    @Override
    public void store(ObjectClassStructure struct, File file) {
        try {
            XmlPersistor xml = XmlPersistor.newRoot("OID_" + struct.getOid());
            new PersistableObjectClassStructure(struct).save(xml);
            xml.store(file);
        } catch (IOException ex) {
            // TODO: Log this
            ex.printStackTrace();
        }
    }
View Full Code Here

    @Override
    public String store(ObjectClassStructure struct) {
        XmlPersistor xml = XmlPersistor.newRoot("OID_" + struct.getOid());
        new PersistableObjectClassStructure(struct).save(xml);
        StringWriter writer = new StringWriter();
        xml.store(writer);
        return writer.toString();
    }

    private ObjectClassStructure load(XmlPersistor xml) {
        PersistableObjectClassStructureFactory factory = new PersistableObjectClassStructureFactory();
View Full Code Here

        try {
            XmlPersistor p = XmlPersistor.newRoot(ROOT);
            for (ObjectClassDefinition classDef : classDefs) {
                persistDefinition(classDef, p);
            }
            p.store(file);
        } catch (IOException ex) {
            logPersistError(ex);
        }
    }
View Full Code Here

            this.dir = dir;
        }

        public void storeProject(IntegrationProject project) throws IOException {
            XmlPersistor p = persistProject(project);
            p.store(dir.getFile(project.getID() + ".xml"));
        }

        private XmlPersistor persistProject(IntegrationProject project) {
            XmlPersistor root = XmlPersistor.newRoot("project");
            storeNameAndId(project, root);
View Full Code Here

            try {
                XmlPersistor xml = XmlPersistor.newRoot("Entity");
                xml.putString("type", entity.getEntityType().name());
                entity.willBeSaved();
                entity.writeTo(xml);
                xml.store(getFile(entity));
                entity.setTransient(false);
            } catch (Exception ex) {
                throw new InterchangeSavingException("An error occurred while saving \"" + entity.getName() + "\" ["
                                + entity.getEntityType() + "]" + ": " + ex.getMessage(), ex);
            }
View Full Code Here

        File target = getProjectStructureFile();
        File copy = createCopyOfProjectStructureFile(target);
        try {
            XmlPersistor xml = XmlPersistor.newRoot("Project");
            ProjectStructurePersistor.save(project, xml);
            xml.store(target);
            validateProjectStructureFile(target, copy);
            if (copy != null) {
                copy.delete();
            }
        } catch (Exception ex) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.