Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.CoreException


      } else {
        // create default workspace for new user
        webWorkspace = createWorkspace(DEFAULT_WORKSPACE);
      }
    } catch (JSONException e) {
      throw new CoreException(new Status(IStatus.ERROR, null, null, e));
    }

    this.userDirectory = new VOrionWorkspaceStorage(webWorkspace, this.getUserID());
   
    rebuildWorkspace();
View Full Code Here


      if (mapper.canSerialize(cachedCommands.getClass())) {
        try {
          serialisedCommands = mapper.writeValueAsString(cachedCommands);
        }
        catch (IOException e) {
          throw new CoreException(CloudFoundryPlugin.getErrorStatus(
              Messages.TunnelServiceCommandStore_ERROR_SERIALIZE_JAVAMAP, e));
        }
      }
      else {
        throw new CoreException(CloudFoundryPlugin.getErrorStatus(NLS.bind(Messages.TunnelServiceCommandStore_ERROR_VALUE_CANNOT_SERILIZE, 
            cachedCommands.getClass().getName())));
      }
    }

    if (serialisedCommands != null) {
View Full Code Here

          File warFile = null;
          if (applicationArchive == null) {
            // Create a full war archive
            warFile = CloudUtil.createWarFile(modules, server, monitor);
            if (warFile == null || !warFile.exists()) {
              throw new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID,
                  "Unable to create war file for application: " + deploymentName)); //$NON-NLS-1$
            }

            CloudFoundryPlugin.trace("War file " + warFile.getName() + " created"); //$NON-NLS-1$ //$NON-NLS-2$
          }
View Full Code Here

              .toCoreException("Failed to deploy application " + appModule.getDeploymentInfo().getDeploymentName() + //$NON-NLS-1$
                  " since no deployable war or application archive file was generated."); //$NON-NLS-1$
        }
      }
      catch (IOException e) {
        throw new CoreException(CloudFoundryPlugin.getErrorStatus("Failed to deploy application " + //$NON-NLS-1$
            appModule.getDeploymentInfo().getDeploymentName() + " due to " + e.getMessage(), e)); //$NON-NLS-1$
      }

    }
View Full Code Here

      @Override
      protected void performOperation(IProgressMonitor monitor) throws CoreException {
        IStatus status = openConnection(monitor);
        if (!status.isOK()) {
          throw new CoreException(status);
        }
      }
    };
  }
View Full Code Here

              // Now verify that the application did start
              try {
                if (!waitForStart(client, deploymentName, progress)) {
                  server.setModuleState(modules, IServer.STATE_STOPPED);

                  throw new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID,
                      "Starting of " + cloudModule.getDeployedApplicationName() + " timed out")); //$NON-NLS-1$ //$NON-NLS-2$
                }
              }
              catch (InterruptedException e) {
                server.setModuleState(modules, IServer.STATE_STOPPED);
View Full Code Here

   */
  public CloudApplicationURL getCloudApplicationURL(String url) throws CoreException {

    IStatus isValidStatus = simpleValidation(url);
    if (!isValidStatus.isOK()) {
      throw new CoreException(isValidStatus);
    }

    if (domainsPerActiveSpace == null || domainsPerActiveSpace.isEmpty()) {
      throw new CoreException(
          CloudFoundryPlugin
              .getErrorStatus(Messages.ApplicationUrlLookupService_ERROR_GET_CLOUD_URL));
    }

    // String url = domain.getName();
    // url = url.replace("http://", "");
    URI newUri;
    try {
      newUri = URI.create(url);
    }
    catch (IllegalArgumentException e) {
      throw new CoreException(CloudFoundryPlugin.getErrorStatus(e));
    }

    String authority = newUri.getScheme() != null ? newUri.getAuthority() : newUri.getPath();
    String parsedDomainName = null;
    String parsedSubdomainName = null;
    if (authority != null) {
      for (CloudDomain domain : domainsPerActiveSpace) {
        // Be sure to check for last segment rather than last String
        // value
        // otherwise: Example: "validdomain" is a valid domain:
        // sub.domainvaliddomain will be parsed
        // successfully as a valid application URL, even though
        // "domainvaliddomain" is not a valid domain. Instead, this
        // should be the correct
        // URL: sub.domain.validdomain. A URL with just "validdomain"
        // should also
        // parse the domain part correctly (but no subdomain)
        String domainName = domain.getName();
        String domainSegment = '.' + domainName;
        if (authority.equals(domainName)) {
          parsedDomainName = domainName;
          break;
        }
        else if (authority.endsWith(domainSegment)) {
          parsedDomainName = domainName;
          // Any portion of the authority before the separating '.' is
          // the
          // subdomain. To avoid including the separating '.' between
          // subdomain and domain itself as being part of the
          // subdomain, only parse the subdomain if there
          // is an actual '.' before the domain value in the authority
          if (domainSegment.length() < authority.length()) {
            parsedSubdomainName = authority.substring(0, authority.lastIndexOf(domainSegment));
          }
          break;
        }
      }
    }

    if (parsedDomainName == null || parsedDomainName.trim().length() == 0) {
      throw new CoreException(CloudFoundryPlugin.getErrorStatus(NLS.bind(
          Messages.ERROR_NO_DOMAIN_RESOLVED_FOR_URL, url)));
    }
    if (parsedSubdomainName == null || parsedSubdomainName.trim().length() == 0l) {
      throw new CoreException(CloudFoundryPlugin.getErrorStatus(NLS.bind(Messages.ERROR_INVALID_SUBDOMAIN, url,
          parsedDomainName)));
    }
    return new CloudApplicationURL(parsedSubdomainName, parsedDomainName);
  }
View Full Code Here

    }

    // Only throw exception if an error was generated and an invalid result
    // was obtained.
    if (!isValid(result) && lastError != null) {
      CoreException coreError = lastError instanceof CoreException ? (CoreException) lastError : CloudErrorUtil
          .toCoreException(lastError);
      throw coreError;
    }
    return result;
  }
View Full Code Here

      throwException(result, "Publishing of : " + module.getName() + " failed"); //$NON-NLS-1$ //$NON-NLS-2$

      return warFile;
    }
    catch (IOException e) {
      throw new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID,
          "Failed to create war file: "+ e.getMessage(), e)); //$NON-NLS-1$
    }
  }
View Full Code Here

      throwException(result, "Publishing of " + modules[0].getName() + " failed"); //$NON-NLS-1$ //$NON-NLS-2$

      return targetFile;
    }
    catch (IOException e) {
      throw new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID,
          "Failed to create war file: " + e.getMessage(), e)); //$NON-NLS-1$
    }

  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.CoreException

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.