Package gov.nysenate.openleg

Examples of gov.nysenate.openleg.Environment


                this.printUsage(opts);
                System.exit(1);
            }
        }

        Environment env = Application.getEnvironment();
        DataProcessor process = new DataProcessor();
        for (String task : tasks) {
            // TODO: With Java7 we can make this a switch case
            if (task.equals("stage")) {
                process.stage(env.getStagingDirectory(), env.getWorkingDirectory());
            }
            else if (task.equals("collate")) {
                process.collate(env.getWorkingDirectory());
            }
            else if (task.equals("ingest")) {
                process.ingest(env.getWorkingDirectory(), Application.getStorage());
                if (changeFile != null) {
                    ChangeLogger.writeToFile(changeFile);
                }
            }
            else if (task.equals("push")) {
                if (ChangeLogger.getChangeLog().isEmpty()) {
                    if (changeFile != null) {
                        ChangeLogger.readFromFile(changeFile);
                    }
                    else {
                        System.err.println("Unable to push with an empty change log.");
                    }
                }
                process.push(Application.getStorage(), ChangeLogger.getEntries(), services);
            }
            else if (task.equalsIgnoreCase("archive")) {
                process.archive(env.getWorkingDirectory(), env.getArchiveDirectory());
            }
            else {
                System.err.println("Invalid task.");
                System.exit(1);
            }
View Full Code Here


        try
        {
            appInstance.config = new Config(propertyFileName);
            appInstance.db = new DB(appInstance.config, "mysqldb");
            appInstance.mailer = new Mailer(appInstance.config, "mailer");
            appInstance.environment = new Environment(appInstance.config, "env");
            appInstance.lucene = new Lucene(new File(appInstance.config.getValue("lucene.directory")), luceneReadOnly);
            appInstance.storage = new Storage(appInstance.environment.getStorageDirectory());
            return true;
        }
        catch (ConfigurationException ce)
View Full Code Here

  private static void loadProperties()
  {
    Properties prop = new Properties();
      try {
        prop.load(new FileInputStream("src/test/resources/properties"));
        env = new Environment(prop.getProperty("environment"));
      }
      catch (IOException ex) {
        ex.printStackTrace();
        }
  }
View Full Code Here

  Environment env;
  @Before
  public void prepareEnv() throws IOException
  {

   env= new Environment("/home/shweta/testing_environment");
  env.reset();


  }
View Full Code Here

TOP

Related Classes of gov.nysenate.openleg.Environment

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.