Refine search
String msg = NLS.bind(PrefsMessages.preferences_fileNotFound, path.toOSString()); throw new CoreException(new Status(IStatus.ERROR, PrefsMessages.OWNER_NAME, 1, msg, null)); service.importPreferences(input); } catch (FileNotFoundException e) { String msg = NLS.bind(PrefsMessages.preferences_fileNotFound, path.toOSString()); throw new CoreException(new Status(IStatus.ERROR, PrefsMessages.OWNER_NAME, 1, msg, e)); } finally { if (input != null)
/** * Throws a core exception. * * @param message message * @param e underlying exception or <code>null</code> * @throws CoreException */ protected void abort(String message, Throwable e) throws CoreException { throw new CoreException(new Status(IStatus.ERROR, ApiPlugin.PLUGIN_ID, message, e)); }
private static void throwWriteException(Throwable t) throws CoreException { // IStatus status= JavaUIStatus.createError(IJavaStatusConstants.TEMPLATE_IO_EXCEPTION, // TemplateMessages.getString("TemplateSet.error.write"), t); //$NON-NLS-1$ // throw new JavaUIException(status); throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.jface.text", TEMPLATE_IO_EXCEPTION, JavaTemplateMessages.TemplateSet_error_write, t)); //$NON-NLS-1$ }
public Plugin(IPluginDescriptor descriptor) { Assert.isNotNull(descriptor); Assert.isTrue(!CompatibilityHelper.hasPluginObject(descriptor), NLS.bind(Messages.plugin_deactivatedLoad, this.getClass().getName(), descriptor.getUniqueIdentifier() + " is not activated")); //$NON-NLS-1$ this.descriptor = descriptor; InternalPlatform.start(bundle); } catch (BundleException e) { String message = NLS.bind(Messages.plugin_startupProblems, descriptor.getUniqueIdentifier()); IStatus status = new Status(IStatus.ERROR, Platform.PI_RUNTIME, IStatus.ERROR, message, e); InternalPlatform.getDefault().log(status);
fos.getFD().sync(); } catch (IOException e) { String message = NLS.bind(PrefsMessages.preferences_errorWriting, file, e.getMessage()); IStatus status = new Status(IStatus.ERROR, PrefsMessages.OWNER_NAME, IStatus.ERROR, message, e); throw new CoreException(status); } finally { if (output != null)
/** * Throws a core exception with the given message and underlying exception (possibly * <code>null</code>). * * @param message message * @param e underlying cause of the exception or <code>null</code> * @throws CoreException */ private void abort(String message, Exception e) throws CoreException { throw new CoreException(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, message, e)); }
/** * @param baseline the baseline that is disposed * @throws CoreException with the baseline disposed information */ protected void baselineDisposed(IApiBaseline baseline) throws CoreException { throw new CoreException(new Status(IStatus.ERROR, ApiPlugin.PLUGIN_ID, ApiPlugin.REPORT_BASELINE_IS_DISPOSED, NLS.bind(Messages.BundleApiComponent_baseline_disposed, baseline.getName()), null)); } }
/** * Creates a <code>CoreException</code> with the given parameters. * * @param message a string with the message * @param ex the exception to be wrapped or <code>null</code> if none * @return a CoreException */ public static CoreException createCoreException(String message, Exception ex) { if (message == null) message= ""; //$NON-NLS-1$ return new CoreException(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, IJavaStatusConstants.INTERNAL_ERROR, message, ex)); }
@Override public IStatus validateInstallLocation(File installLocation) { if (installLocation.exists()) { return new Status(IStatus.INFO, LaunchingPlugin.ID_PLUGIN, LaunchingMessages.EEVMType_4); } return new Status(IStatus.ERROR, LaunchingPlugin.ID_PLUGIN, NLS.bind(LaunchingMessages.EEVMType_3, new String[]{installLocation.getPath()})); }
public void move(IPath oldPath, IPath newPath) throws CoreException { File oldFile = getFile(oldPath, false); // TODO lock hierarchy and throw an exception if oldFile is in use if (oldFile.exists()) { File newFile = getFile(newPath, false); newFile.getParentFile().mkdirs(); if (!oldFile.renameTo(newFile)) { throw new CoreException(new Status(IStatus.ERROR, CommonsCorePlugin.ID_PLUGIN, NLS.bind( "The target path ''{0}'' already exists", newPath))); //$NON-NLS-1$ } } }
public static void setDefault(IRegistryProvider provider) throws CoreException { if (defaultRegistryProvider != null) { Status status = new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, IRegistryConstants.PLUGIN_ERROR, RegistryMessages.registry_default_exists, null); throw new CoreException(status); } defaultRegistryProvider = provider; }
@Override void save(ITargetDefinition definition) throws CoreException { OutputStream stream = getOutputStream(); ((TargetDefinition) definition).write(stream); try { stream.close(); } catch (IOException e) { throw new CoreException(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, NLS.bind(Messages.LocalTargetHandle_4, getFile().getName()), e)); } }
public static void setDefault(IRegistryProvider provider) throws CoreException { if (defaultRegistryProvider != null) { Status status = new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, IRegistryConstants.PLUGIN_ERROR, RegistryMessages.registry_default_exists, null); throw new CoreException(status); } defaultRegistryProvider = provider; }
private IStatus validateState(String id, long timestamp) { long[] states = listProfileTimestamps(id); for (long ts : states) if (ts == timestamp) return Status.OK_STATUS; return new Status(IStatus.ERROR, EngineActivator.ID, (NLS.bind(Messages.SimpleProfileRegistry_state_not_found, timestamp, id))); }
private void importJar(File jar, IResource destination, IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { try (ZipFile input = new ZipFile(jar);) { ZipFileStructureProvider provider = new ZipFileStructureProvider(input); ImportOperation op = new ImportOperation(destination.getFullPath(), provider.getRoot(), provider, pathString -> IOverwriteQuery.ALL); op.run(monitor); } catch (IOException e) { throw new CoreException(new Status(IStatus.ERROR, IPDEUIConstants.PLUGIN_ID, IStatus.OK, NLS.bind(PDEUIMessages.NewProjectCreationOperation_errorImportingJar, jar), e)); } }
public void throwParseErrorsException(Throwable e) throws CoreException { Status status = new Status(IStatus.ERROR, PDECore.PLUGIN_ID, IStatus.OK, "Error in the manifest file", //$NON-NLS-1$ e); throw new CoreException(status); }
@Override protected void onClose(String digestString) { // if the hashes don't line up set the status to error. if (!digestString.equals(expectedMD5)) setStatus(new Status(IStatus.ERROR, Activator.ID, ProvisionException.ARTIFACT_MD5_NOT_MATCH, NLS.bind(Messages.Error_unexpected_hash, expectedMD5, digestString), null)); } }