public long getCacheTimestamp() throws CoreException { try { return Long.parseLong(workspace.getRoot().getPersistentProperty(CACHE_TIMESTAMP)); } catch (NumberFormatException e) { return 0; } }
public long getCacheTimestamp() throws CoreException { try { return Long.parseLong(workspace.getRoot().getPersistentProperty(CACHE_TIMESTAMP)); } catch (NumberFormatException e) { return 0; } }
public long getCacheTimestamp() throws CoreException { try { return Long.parseLong(workspace.getRoot().getPersistentProperty(CACHE_TIMESTAMP)); } catch (NumberFormatException e) { return 0; } }
/** Public so tests can examine it. */ public synchronized byte getCacheState() { if (cacheState != 0) // we have read/set it before, no nead to read property return cacheState; String persisted; try { persisted = workspace.getRoot().getPersistentProperty(CACHE_STATE); cacheState = persisted != null ? Byte.parseByte(persisted) : INVALID_CACHE; } catch (NumberFormatException e) { cacheState = INVALID_CACHE; } catch (CoreException e) { Policy.log(e.getStatus()); cacheState = INVALID_CACHE; } return cacheState; }
/** Public so tests can examine it. */ public synchronized byte getCacheState() { if (cacheState != 0) // we have read/set it before, no nead to read property return cacheState; String persisted; try { persisted = workspace.getRoot().getPersistentProperty(CACHE_STATE); cacheState = persisted != null ? Byte.parseByte(persisted) : INVALID_CACHE; } catch (NumberFormatException e) { cacheState = INVALID_CACHE; } catch (CoreException e) { Policy.log(e.getStatus()); cacheState = INVALID_CACHE; } return cacheState; }
public static String getSourceAttachmentProperty(IPath path) throws JavaModelException { Map rootPathToAttachments = JavaModelManager.getJavaModelManager().rootPathToAttachments; String property = (String) rootPathToAttachments.get(path); if (property == null) { try { property = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(getSourceAttachmentPropertyName(path)); if (property == null) { rootPathToAttachments.put(path, PackageFragmentRoot.NO_SOURCE_ATTACHMENT); return null; } rootPathToAttachments.put(path, property); return property; } catch (CoreException e) { throw new JavaModelException(e); } } else if (property.equals(PackageFragmentRoot.NO_SOURCE_ATTACHMENT)) { return null; } else return property; }
public static String getSourceAttachmentProperty(IPath path) throws JavaModelException { Map rootPathToAttachments = JavaModelManager.getJavaModelManager().rootPathToAttachments; String property = (String) rootPathToAttachments.get(path); if (property == null) { try { property = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(getSourceAttachmentPropertyName(path)); if (property == null) { rootPathToAttachments.put(path, PackageFragmentRoot.NO_SOURCE_ATTACHMENT); return null; } rootPathToAttachments.put(path, property); return property; } catch (CoreException e) { throw new JavaModelException(e); } } else if (property.equals(PackageFragmentRoot.NO_SOURCE_ATTACHMENT)) { return null; } else return property; }
/** Public so tests can examine it. */ public synchronized byte getCacheState() { if (cacheState != 0) // we have read/set it before, no nead to read property return cacheState; String persisted; try { persisted = workspace.getRoot().getPersistentProperty(CACHE_STATE); cacheState = persisted != null ? Byte.parseByte(persisted) : INVALID_CACHE; } catch (NumberFormatException e) { cacheState = INVALID_CACHE; } catch (CoreException e) { Policy.log(e.getStatus()); cacheState = INVALID_CACHE; } return cacheState; }
public static String getSourceAttachmentProperty(IPath path) throws JavaModelException { Map rootPathToAttachments = JavaModelManager.getJavaModelManager().rootPathToAttachments; String property = (String) rootPathToAttachments.get(path); if (property == null) { try { property = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(getSourceAttachmentPropertyName(path)); if (property == null) { rootPathToAttachments.put(path, PackageFragmentRoot.NO_SOURCE_ATTACHMENT); return null; } rootPathToAttachments.put(path, property); return property; } catch (CoreException e) { throw new JavaModelException(e); } } else if (property.equals(PackageFragmentRoot.NO_SOURCE_ATTACHMENT)) { return null; } else return property; }
public static String getSourceAttachmentProperty(IPath path) throws JavaModelException { Map rootPathToAttachments = JavaModelManager.getJavaModelManager().rootPathToAttachments; String property = (String) rootPathToAttachments.get(path); if (property == null) { try { property = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(getSourceAttachmentPropertyName(path)); if (property == null) { rootPathToAttachments.put(path, PackageFragmentRoot.NO_SOURCE_ATTACHMENT); return null; } rootPathToAttachments.put(path, property); return property; } catch (CoreException e) { throw new JavaModelException(e); } } else if (property.equals(PackageFragmentRoot.NO_SOURCE_ATTACHMENT)) { return null; } else return property; }
public static String getSourceAttachmentProperty(IPath path) throws JavaModelException { Map rootPathToAttachments = JavaModelManager.getJavaModelManager().rootPathToAttachments; String property = (String) rootPathToAttachments.get(path); if (property == null) { try { property = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(getSourceAttachmentPropertyName(path)); if (property == null) { rootPathToAttachments.put(path, PackageFragmentRoot.NO_SOURCE_ATTACHMENT); return null; } rootPathToAttachments.put(path, property); return property; } catch (CoreException e) { throw new JavaModelException(e); } } else if (property.equals(PackageFragmentRoot.NO_SOURCE_ATTACHMENT)) { return null; } else return property; }
public static String getSourceAttachmentProperty(IPath path) throws JavaModelException { Map rootPathToAttachments = JavaModelManager.getJavaModelManager().rootPathToAttachments; String property = (String) rootPathToAttachments.get(path); if (property == null) { try { property = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(getSourceAttachmentPropertyName(path)); if (property == null) { rootPathToAttachments.put(path, PackageFragmentRoot.NO_SOURCE_ATTACHMENT); return null; } rootPathToAttachments.put(path, property); return property; } catch (CoreException e) { throw new JavaModelException(e); } } else if (property.equals(PackageFragmentRoot.NO_SOURCE_ATTACHMENT)) { return null; } else return property; }
public static String getSourceAttachmentProperty(IPath path) throws JavaModelException { Map rootPathToAttachments = JavaModelManager.getJavaModelManager().rootPathToAttachments; String property = (String) rootPathToAttachments.get(path); if (property == null) { try { property = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(getSourceAttachmentPropertyName(path)); if (property == null) { rootPathToAttachments.put(path, PackageFragmentRoot.NO_SOURCE_ATTACHMENT); return null; } rootPathToAttachments.put(path, property); return property; } catch (CoreException e) { throw new JavaModelException(e); } } else if (property.equals(PackageFragmentRoot.NO_SOURCE_ATTACHMENT)) { return null; } else return property; }
public void loadVariablesAndContainers() throws CoreException { String xmlString = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(qName);
public void loadVariablesAndContainers() throws CoreException { String xmlString = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(qName);
public void loadVariablesAndContainers() throws CoreException { String xmlString = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(qName);
public void loadVariablesAndContainers() throws CoreException { String xmlString = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(qName);
String xmlString= root.getPersistentProperty(QUALIFIED_NAME); if (xmlString != null) { // only set when workspace is old Reader reader= new StringReader(xmlString);
String xmlString= root.getPersistentProperty(QUALIFIED_NAME); if (xmlString != null) { // only set when workspace is old Reader reader= new StringReader(xmlString);
/** * Return true if the global preferences are at the current level of metadata, false otherwise. */ public boolean isGlobalMigrated() throws InvocationTargetException { IWorkspaceRoot root = ValidationConfiguration.getRoot(); if (root == null) { return false; } try { GlobalConfiguration gp = (GlobalConfiguration) root.getSessionProperty(USER_PREFERENCE); if (gp != null) { return gp.isVersionCurrent(); } String serializedPrjp = root.getPersistentProperty(USER_PREFERENCE); if (serializedPrjp != null) { gp = new GlobalConfiguration(root); gp.getVersion(); // initialize the configuration's version attribute return gp.isVersionCurrent(); } } catch (CoreException exc) { throw new InvocationTargetException(exc, ResourceHandler.getExternalizedMessage(ResourceConstants.VBF_EXC_RETRIEVE, new String[]{root.getName()})); } return false; }