use of org.eclipse.core.runtime.MultiStatus in project epp.mpc by eclipse.
the class MarketplaceUnmarshaller method createContentError.
private IStatus createContentError(ByteBuffer peekBuffer, String message, Throwable t) {
IStatus status = createErrorStatus(message, t);
if (peekBuffer != null && peekBuffer.hasRemaining()) {
IStatus contentInfo = createContentInfo(peekBuffer);
if (contentInfo != null) {
MultiStatus multiStatus = new MultiStatus(status.getPlugin(), status.getCode(), status.getMessage(), status.getException());
multiStatus.add(contentInfo);
status = multiStatus;
}
}
return status;
}
use of org.eclipse.core.runtime.MultiStatus in project epp.mpc by eclipse.
the class MarketplaceClientCore method computeStatus.
public static IStatus computeStatus(Throwable e, String message) {
Throwable cause = e;
if (e instanceof InvocationTargetException) {
cause = e.getCause();
}
IStatus statusCause = computeWellknownProblemStatus(e);
if (statusCause == null) {
if (cause instanceof CoreException) {
statusCause = ((CoreException) cause).getStatus();
} else {
statusCause = new Status(IStatus.ERROR, BUNDLE_ID, cause.getMessage(), cause);
}
}
if (message == null || "".equals(message.trim())) {
// $NON-NLS-1$
message = statusCause.getMessage();
} else if (statusCause.getMessage() != null && !"".equals(statusCause.getMessage().trim())) {
// $NON-NLS-1$
message = NLS.bind(Messages.MarketplaceClientCore_message_message2, message, statusCause.getMessage());
}
IStatus status = new MultiStatus(BUNDLE_ID, 0, new IStatus[] { statusCause }, message, cause);
return status;
}
use of org.eclipse.core.runtime.MultiStatus in project jbosstools-openshift by jbosstools.
the class OpenShiftPublishController method publishStart.
@Override
public void publishStart(final IProgressMonitor monitor) throws CoreException {
this.syncDownFailed = false;
IServer server = getServer();
this.rsync = createRsync(server, monitor);
final File localDirectory = getLocalFolder();
final MultiStatus status = new MultiStatus(OpenShiftCoreActivator.PLUGIN_ID, 0, NLS.bind("Error while publishing server {0}. Could not sync all pods to folder {1}", server.getName(), localDirectory.getAbsolutePath()), null);
rsync.syncPodsToDirectory(localDirectory, status, ServerConsoleModel.getDefault().getConsoleWriter());
if (!status.isOK()) {
handleSyncDownFailure(status);
}
final IProject deployProject = OpenShiftServerUtils.checkedGetDeployProject(server);
// If the magic project is *also* a module on the server, do nothing
if (!modulesIncludesMagicProject(getServer(), deployProject)) {
publishModule(monitor, deployProject, localDirectory);
}
}
use of org.eclipse.core.runtime.MultiStatus in project jbosstools-openshift by jbosstools.
the class OpenShiftPublishController method syncUp.
protected void syncUp(final File localFolder, final IResource resource) throws CoreException {
final MultiStatus status = new MultiStatus(OpenShiftCoreActivator.PLUGIN_ID, 0, NLS.bind("Could not sync {0} to all pods running the service {1}", localFolder, resource.getName()), null);
rsync.syncDirectoryToPods(localFolder, status, ServerConsoleModel.getDefault().getConsoleWriter());
if (!status.isOK()) {
throw new CoreException(status);
}
}
use of org.eclipse.core.runtime.MultiStatus in project jbosstools-openshift by jbosstools.
the class OpenShiftEapModulesController method syncDown.
private MultiStatus syncDown(IProgressMonitor monitor) throws CoreException {
final RSync rsync = OpenShiftServerUtils.createRSync(getServer(), monitor);
final File localDeploymentDirectory = new File(getDeploymentOptions().getDeploymentsRootFolder(true));
final MultiStatus status = new MultiStatus(OpenShiftCoreActivator.PLUGIN_ID, IStatus.OK, NLS.bind("Could not sync all pods to folder {0}.", localDeploymentDirectory.getAbsolutePath()), null);
rsync.syncPodsToDirectory(localDeploymentDirectory, status, ServerConsoleModel.getDefault().getConsoleWriter());
return status;
}
Aggregations