public IStatus validate(URI location, IProgressMonitor monitor) { try { ExtensionLocationMetadataRepository.validate(location, monitor); } catch (ProvisionException e) { return e.getStatus(); } return Status.OK_STATUS; }
/** * Get default "InternalError" ProvisionException. * @param t * @return a default "InternalError" */ public static ProvisionException internalError(Throwable t) { return new ProvisionException(new Status(IStatus.ERROR, Activator.ID, // ProvisionException.INTERNAL_ERROR, Messages.repoMan_internalError, t)); } }
/** * Return an error status that can be used to report the specified exception. * * @param message the message that should be used in the status * @param e the exception to be reported * @return a status that can be used to describe the exception */ protected IStatus getErrorStatus(String message, ProvisionException e) { if (message == null) if (e == null) message = NLS.bind(Messages.ProvisioningJob_GenericErrorStatusMessage, getName()); else message = e.getLocalizedMessage(); return new Status(IStatus.ERROR, Activator.ID, message, e); }
void reload() { try { ExtensionLocationArtifactRepositoryFactory factory = new ExtensionLocationArtifactRepositoryFactory(); factory.setAgent(getProvisioningAgent()); ExtensionLocationArtifactRepository repo = (ExtensionLocationArtifactRepository) factory.load(getLocation(), 0, null); artifactRepository = repo.artifactRepository; base = repo.base; } catch (ProvisionException e) { //unexpected e.printStackTrace(); throw new IllegalStateException(e.getMessage()); } }
/** * Creates a profile given an id, location, and flavor */ public void _provaddprofile(CommandInterpreter interpreter) { String profileId = interpreter.nextArgument(); String location = interpreter.nextArgument(); if (profileId == null || location == null) { interpreter.println("Id and location must be provided"); return; } String environments = interpreter.nextArgument(); Map<String, String> props = new HashMap<String, String>(); props.put(IProfile.PROP_INSTALL_FOLDER, location); if (environments != null) props.put(IProfile.PROP_ENVIRONMENTS, environments); try { ProvisioningHelper.addProfile(agent, profileId, props); } catch (ProvisionException e) { interpreter.println("Add profile failed. " + e.getMessage()); interpreter.printStackTrace(e); } }
void reload() { try { ExtensionLocationArtifactRepositoryFactory factory = new ExtensionLocationArtifactRepositoryFactory(); factory.setAgent(getProvisioningAgent()); ExtensionLocationArtifactRepository repo = (ExtensionLocationArtifactRepository) factory.load(getLocation(), 0, null); artifactRepository = repo.artifactRepository; base = repo.base; } catch (ProvisionException e) { //unexpected e.printStackTrace(); throw new IllegalStateException(e.getMessage(), e); } }
public IStatus validate(URI location, IProgressMonitor monitor) { try { ExtensionLocationMetadataRepository.validate(location, monitor); } catch (ProvisionException e) { return e.getStatus(); } return Status.OK_STATUS; }
/** * Get default "InternalError" ProvisionException. * @param t * @return a default "InternalError" */ public static ProvisionException internalError(Throwable t) { return new ProvisionException(new Status(IStatus.ERROR, Activator.ID, // ProvisionException.INTERNAL_ERROR, Messages.repoMan_internalError, t)); } }
void reload() { try { ExtensionLocationArtifactRepositoryFactory factory = new ExtensionLocationArtifactRepositoryFactory(); factory.setAgent(getProvisioningAgent()); ExtensionLocationArtifactRepository repo = (ExtensionLocationArtifactRepository) factory.load(getLocation(), 0, null); artifactRepository = repo.artifactRepository; base = repo.base; } catch (ProvisionException e) { //unexpected e.printStackTrace(); throw new IllegalStateException(e.getMessage(), e); } }
/** * Return an error status that can be used to report the specified exception. * * @param message the message that should be used in the status * @param e the exception to be reported * @return a status that can be used to describe the exception */ protected IStatus getErrorStatus(String message, ProvisionException e) { if (message == null) if (e == null) message = NLS.bind(Messages.ProvisioningJob_GenericErrorStatusMessage, getName()); else message = e.getLocalizedMessage(); return new Status(IStatus.ERROR, Activator.ID, message, e); }
public IStatus validate(URI location, IProgressMonitor monitor) { try { ExtensionLocationArtifactRepository.validate(location, monitor); } catch (ProvisionException e) { return e.getStatus(); } return Status.OK_STATUS; }
private static void fail(URI location, int code) throws ProvisionException { switch (code) { case ProvisionException.REPOSITORY_NOT_FOUND : String msg = NLS.bind(Messages.io_NotFound, location); throw new ProvisionException(new Status(IStatus.ERROR, EngineActivator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null)); case ProvisionException.REPOSITORY_FAILED_READ : msg = NLS.bind(Messages.io_FailedRead, location); throw new ProvisionException(new Status(IStatus.ERROR, EngineActivator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null)); } } }
void reload() { try { ExtensionLocationMetadataRepositoryFactory factory = new ExtensionLocationMetadataRepositoryFactory(); factory.setAgent(getProvisioningAgent()); ExtensionLocationMetadataRepository repo = (ExtensionLocationMetadataRepository) factory.load(getLocation(), 0, null); metadataRepository = repo.metadataRepository; base = repo.base; } catch (ProvisionException e) { //unexpected e.printStackTrace(); throw new IllegalStateException(e.getMessage(), e); } }
protected Object[] fetchChildren(Object o, IProgressMonitor monitor) { SubMonitor sub = SubMonitor.convert(monitor, 200); // Ensure the repository is loaded using the monitor, so we respond to cancelation. // Otherwise, a non-loaded repository could be loaded in the query provider without a monitor. // If the load fails, return an explanation element. try { getMetadataRepository(sub.newChild(100)); //only invoke super if we successfully loaded the repository return super.fetchChildren(o, sub.newChild(100)); } catch (ProvisionException e) { getProvisioningUI().getRepositoryTracker().reportLoadFailure(location, e); // TODO see https://bugs.eclipse.org/bugs/show_bug.cgi?id=276784 return new Object[] {new EmptyElementExplanation(this, IStatus.ERROR, e.getLocalizedMessage(), "")}; //$NON-NLS-1$ } }
public IStatus validate(URI location, IProgressMonitor monitor) { try { ExtensionLocationArtifactRepository.validate(location, monitor); } catch (ProvisionException e) { return e.getStatus(); } return Status.OK_STATUS; }
private static void fail(URI location, int code) throws ProvisionException { switch (code) { case ProvisionException.REPOSITORY_NOT_FOUND : String msg = NLS.bind(Messages.io_NotFound, location); throw new ProvisionException(new Status(IStatus.ERROR, EngineActivator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null)); case ProvisionException.REPOSITORY_FAILED_READ : msg = NLS.bind(Messages.io_FailedRead, location); throw new ProvisionException(new Status(IStatus.ERROR, EngineActivator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null)); } } }
void reload() { try { ExtensionLocationMetadataRepositoryFactory factory = new ExtensionLocationMetadataRepositoryFactory(); factory.setAgent(getProvisioningAgent()); ExtensionLocationMetadataRepository repo = (ExtensionLocationMetadataRepository) factory.load(getLocation(), 0, null); metadataRepository = repo.metadataRepository; base = repo.base; } catch (ProvisionException e) { //unexpected e.printStackTrace(); throw new IllegalStateException(e.getMessage(), e); } }
public IStatus validate(URI location, IProgressMonitor monitor) { try { ExtensionLocationArtifactRepository.validate(location, monitor); } catch (ProvisionException e) { return e.getStatus(); } return Status.OK_STATUS; }
private ProvisionException failedWrite(Exception e) throws ProvisionException { String msg = NLS.bind(Messages.repoFailedWrite, getLocation()); throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_WRITE, msg, e)); }
void reload() { try { ExtensionLocationMetadataRepositoryFactory factory = new ExtensionLocationMetadataRepositoryFactory(); factory.setAgent(getProvisioningAgent()); ExtensionLocationMetadataRepository repo = (ExtensionLocationMetadataRepository) factory.load(getLocation(), 0, null); metadataRepository = repo.metadataRepository; base = repo.base; } catch (ProvisionException e) { //unexpected e.printStackTrace(); throw new IllegalStateException(e.getMessage()); } }