Package org.openstreetmap.osmosis.core.util

Examples of org.openstreetmap.osmosis.core.util.ResourceFileManager


   */
  private void initializeDirectory() {
    File configFile;
    File dataDirectory;
   
    ResourceFileManager resourceFileManager;
   
    // Instantiate utility objects.
    resourceFileManager = new ResourceFileManager();
   
    // Build file objects from file names.
    configFile = new File(workingDirectory, CONFIG_FILE_NAME);
   
    // Copy the template configuration file into the working directory.
    if (configFile.exists()) {
      throw new OsmosisRuntimeException("Config file " + configFile + " already exists.");
    }
    resourceFileManager.copyResourceToFile(getClass(), CONFIG_RESOURCE, configFile);
   
    // Create the data directory.
    dataDirectory = new File(workingDirectory, DATA_DIRECTORY);
    if (dataDirectory.exists()) {
      throw new OsmosisRuntimeException("Data directory " + dataDirectory + " already exists.");
View Full Code Here


   * Initializes a working directory.
   */
  private void initializeDirectory() {
    File configFile;
   
    ResourceFileManager resourceFileManager;
   
    // Instantiate utility objects.
    resourceFileManager = new ResourceFileManager();
   
    // Build file objects from file names.
    configFile = new File(workingDirectory, CONFIG_FILE_NAME);
   
    if (configFile.exists()) {
      throw new OsmosisRuntimeException("Config file " + CONFIG_FILE_NAME + " already exists.");
    }
    resourceFileManager.copyResourceToFile(getClass(), CONFIG_RESOURCE, configFile);
  }
View Full Code Here

  private void initializeDirectory() {
    File configFile;
    File timestampFile;
    File newTimestampFile;
   
    ResourceFileManager resourceFileManager;
   
    // Instantiate utility objects.
    resourceFileManager = new ResourceFileManager();
   
    // Build file objects from file names.
    configFile = new File(workingDirectory, CONFIG_FILE_NAME);
    timestampFile = new File(workingDirectory, TSTAMP_FILE_NAME);
    newTimestampFile = new File(workingDirectory, TSTAMP_NEW_FILE_NAME);
   
    if (configFile.exists()) {
      throw new OsmosisRuntimeException("Config file " + CONFIG_FILE_NAME + " already exists.");
    }
    resourceFileManager.copyResourceToFile(getClass(), CONFIG_RESOURCE, configFile);
   
    if (timestampFile.exists()) {
      throw new OsmosisRuntimeException("Timestamp file " + TSTAMP_FILE_NAME + " already exists.");
    }
   
View Full Code Here

   *            The current offset into the arguments.
   */
  private void initializeCommand(String[] args, int initialArgIndex) {
    int currentArgIndex;
    Date initialExtractDate;
    ResourceFileManager resourceFileManager;

    // Get the command line arguments.
    currentArgIndex = initialArgIndex;
    initialExtractDate = getDateArgument(args, currentArgIndex++);

    if (CONFIG_FILE.exists()) {
      throw new OsmosisRuntimeException("Config file " + CONFIG_FILE + " already exists.");
    }
    resourceFileManager = new ResourceFileManager();
    resourceFileManager.copyResourceToFile(getClass(), CONFIG_RESOURCE, CONFIG_FILE);

    if (!DATA_DIR.exists()) {
      if (!DATA_DIR.mkdir()) {
        throw new OsmosisRuntimeException("Unable to create directory " + DATA_DIR);
      }
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.core.util.ResourceFileManager

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.