Examples of AutoIngestor


Examples of org.fcrepo.client.utility.ingest.AutoIngestor

    final void process() throws Exception {
        //System.err.println("in BatchIngest.process()");
        pidMaps = new Hashtable<String, String>();
        keys = new Vector<String>();
        //AutoIngestor autoIngestor = new AutoIngestor(protocol, host, port, username, password);
        AutoIngestor autoIngestor = new AutoIngestor(APIA, APIM);

        //get files from batchDirectory
        File[] files = null;
        {
            File batchDirectory = new File(objectsPath);
            files = batchDirectory.listFiles();
        }

        if (!(pidsFormat.equals("xml") || pidsFormat.equals("text"))) {
            System.err.println("bad pidsFormat: " + pidsFormat);
        } else if (!objectFormat.equals(FOXML1_1.uri)
                && !objectFormat.equals(METS_EXT1_1.uri)) {
            System.err.println("bad objectFormat: " + objectFormat);
        } else {
            int badFileCount = 0;
            int succeededIngestCount = 0;
            int failedIngestCount = 0;
            String logMessage = "another fedora object";
            for (int i = 0; i < files.length; i++) {
                if (!files[i].isFile()) {
                    badFileCount++;
                    System.err
                            .println("batch directory contains unexpected directory or file: "
                                    + files[i].getName());
                } else {
                    String pid = null;
                    try {
                        pid =
                                autoIngestor
                                        .ingestAndCommit(new FileInputStream(files[i]),
                                                         objectFormat,
                                                         logMessage);
                    } catch (Exception e) {
                        System.err.println("ingest failed for: "
View Full Code Here

Examples of org.fcrepo.client.utility.ingest.AutoIngestor

                FedoraClient fc = new FedoraClient(baseURL, username, password);
                APIA = fc.getAPIAMTOM();
                APIM = fc.getAPIMMTOM();
                fc.shutdown();
                //*******************************************
                AutoIngestor autoIngestor = new AutoIngestor(APIA, APIM);

                new MassIngest(autoIngestor, f, dictFile, format, Integer
                        .parseInt(args[7]));
            }
        } catch (Exception e) {
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.