Package com.puppetlabs.geppetto.forge.client

Examples of com.puppetlabs.geppetto.forge.client.ForgeException


      throw new UnsupportedOperationException(
        "Unable to publish since no release service is configured. Was a serviceURL provided in the preferences?");

    Metadata metadata = forgeUtil.getMetadataFromPackage(moduleArchive);
    if(metadata == null)
      throw new ForgeException("No \"metadata.json\" found in archive: " + moduleArchive.getAbsolutePath());

    if(metadata.getName() == null)
      throw new ForgeException("The \"metadata.json\" found in archive: " + moduleArchive.getAbsolutePath() +
          " has no name");

    if(metadata.getVersion() == null)
      throw new ForgeException("The \"metadata.json\" found in archive: " + moduleArchive.getAbsolutePath() +
          " has no version");

    try {
      if(metadataRepo.resolve(metadata.getName(), metadata.getVersion()) != null)
        throw new AlreadyPublishedException("Module " + metadata.getName() + ':' + metadata.getVersion() +
            " has already been published");
    }
    catch(HttpResponseException e) {
      // A SC_NOT_FOUND can be expected and is OK.
      if(e.getStatusCode() != HttpStatus.SC_NOT_FOUND)
        throw new ForgeException("Unable to check module existence on the forge: " + e.getMessage());
    }

    if(dryRun) {
      result.addChild(new Diagnostic(INFO, PUBLISHER, "Module file " + moduleArchive.getName() +
          " would have been uploaded (but wasn't since this is a dry run)"));
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.forge.client.ForgeException

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.