Package nz.govt.natlib.meta.config

Examples of nz.govt.natlib.meta.config.Configuration


    if (adapter != null) {
      System.out.println("Adaper");
      System.out.println("  Name :" + adapter.getName());
      System.out.println("  Version :" + adapter.getVersion());
      System.out.println("  Description :" + adapter.getDescription());
      Configuration config = (Configuration) Config.getInstance()
          .getAvailableConfigs().get(con);
      System.out.println("Using Configuration :" + config.getName());
      File outDir = new File(config.getOutputDirectory());
      outDir.mkdirs(); // precaution, in case the directories are not
                // there on this machine...
      System.out.println("Output: " + outDir.getAbsolutePath());

      Harvester harvester = new POCHarvester();
View Full Code Here


        try {
            File file = DigitalObjectUtils.toFile(digitalObject);
            /* Create a HarvestSource of the object we want to harvest */
            FileHarvestSource source = new FileHarvestSource(file);
            /* Get the native Configuration: */
            Configuration c = Config.getInstance().getConfiguration("Extract in Native form");
            String tempFolder = file.getParent();
            c.setOutputDirectory(tempFolder);
            /* Harvest the file: */
            c.getHarvester().harvest(c, source, new PropsManager());
            /* The resulting file is the original file plus ".xml": */
            File result = new File(c.getOutputDirectory() + File.separator + file.getName()
                    + ".xml");
            result.deleteOnExit();
            return read(result.getAbsolutePath());
        } catch (ConfigurationException e) {
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of nz.govt.natlib.meta.config.Configuration

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.