本文整理汇总了Java中org.eclipse.core.resources.IResourceStatus.RESOURCE_NOT_FOUND属性的典型用法代码示例。如果您正苦于以下问题:Java IResourceStatus.RESOURCE_NOT_FOUND属性的具体用法?Java IResourceStatus.RESOURCE_NOT_FOUND怎么用?Java IResourceStatus.RESOURCE_NOT_FOUND使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.core.resources.IResourceStatus
的用法示例。
在下文中一共展示了IResourceStatus.RESOURCE_NOT_FOUND属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: purgeCache
public void purgeCache(IContainer root, boolean deep) throws SVNException {
int depth = deep ? IResource.DEPTH_INFINITE : IResource.DEPTH_ZERO;
try {
if (root.exists() || root.isPhantom()) {
ResourcesPlugin.getWorkspace().getSynchronizer().flushSyncInfo(StatusCacheManager.SVN_BC_SYNC_KEY, root, depth);
}
if (deep) {
accessor.removeRecursiveFromPendingCache(root);
} else {
accessor.removeFromPendingCache(root);
}
} catch (CoreException e) {
if (e.getStatus().getCode() == IResourceStatus.RESOURCE_NOT_FOUND) {
// Must have been deleted since we checked
return;
}
throw SVNException.wrapException(e);
}
}
示例2: isSupervised
public boolean isSupervised(IResource resource) throws TeamException {
try {
if (resource.isTeamPrivateMember() || SVNWorkspaceRoot.isLinkedResource(resource)) return false;
RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject(), SVNProviderPlugin.getTypeId());
if (provider == null) return false;
// TODO: what happens for resources that don't exist?
// TODO: is it proper to use ignored here?
ISVNLocalResource svnThing = SVNWorkspaceRoot.getSVNResourceFor(resource);
if (svnThing.isIgnored()) {
// An ignored resource could have an incoming addition (conflict)
return (remoteSyncStateStore.getBytes(resource) != null) ||
((remoteSyncStateStore.members(resource) != null) && (remoteSyncStateStore.members(resource).length > 0));
}
return true;
} catch (TeamException e) {
// If there is no resource in coe this measn there is no local and no remote
// so the resource is not supervised.
if (e.getStatus().getCode() == IResourceStatus.RESOURCE_NOT_FOUND) {
return false;
}
throw e;
}
}
示例3: checkExists
/**
* Checks that this resource exists. If checkType is true, the type of this resource and the one
* in the tree must match.
*
* @exception CoreException if this resource does not exist
*/
public void checkExists(int flags, boolean checkType) throws CoreException {
if (!exists(flags, checkType)) {
String message = NLS.bind(Messages.resources_mustExist, getFullPath());
throw new ResourceException(IResourceStatus.RESOURCE_NOT_FOUND, getFullPath(), message, null);
}
}
示例4: accept
/**
* Visits all existing resources defined by this traversal.
*
* @param visitor a resource visitor
* @exception CoreException if this method fails. Reasons include:
* <ul>
* <li>The visitor failed with this exception.
* </ul>
*/
public void accept(IResourceVisitor visitor) throws CoreException {
for (int i = 0, imax = resources.length; i < imax; i++)
try {
if (resources[i].exists()) resources[i].accept(visitor, depth, flags);
} catch (CoreException e) {
// ignore failure in the case of concurrent deletion
if (e.getStatus().getCode() != IResourceStatus.RESOURCE_NOT_FOUND) throw e;
}
}
示例5: demandLoadResource
/**
*
* Discards the current content of the resource, sets the parser result as first slot, installs derived state (this
* will build up the second slot again) and sends notifications that proxies have been resolved. The resource will
* be even loaded if its already marked as loaded.
*
* If the second slot, that is the TModule, was already loaded and we just resolved the AST, then the existing
* TModule is kept in the resource and rewired to the resolved AST.
*
* @param object
* the object which resource should be loaded
* @return the loaded/resolved object
*/
private EObject demandLoadResource(EObject object) {
TModule oldModule = null;
EObject oldScript = null;
ModuleAwareContentsList myContents = ((ModuleAwareContentsList) contents);
try {
oldModule = discardStateFromDescription(false);
if (!myContents.isEmpty()) {
oldScript = myContents.basicGet(0);
myContents.sneakyClear();
}
// now everything is removed from the resource and contents is empty
// stop sending notifications
eSetDeliver(false);
if (isLoaded) {
// Loads the resource even its marked as being already loaded
isLoaded = false;
}
superLoad(null);
// manually send the notification
eSetDeliver(true);
EObject result = getParseResult().getRootASTElement();
if (myContents.isEmpty()) {
myContents.sneakyAdd(0, result);
if (oldModule != null) {
myContents.sneakyAdd(oldModule);
}
forceInstallDerivedState(false);
} else {
if (myContents.size() == 1) {
if (oldModule != null) {
myContents.sneakyAdd(oldModule);
}
}
installDerivedState(false);
}
if (oldScript != null) {
notifyProxyResolved(0, oldScript);
}
fullyPostProcessed = false;
return result;
} catch (IOException | IllegalStateException ioe) {
if (myContents.isEmpty()) {
myContents.sneakyAdd(oldScript);
myContents.sneakyAdd(oldModule);
}
Throwable cause = ioe.getCause();
if (cause instanceof CoreException) {
IStatus status = ((CoreException) cause).getStatus();
if (IResourceStatus.RESOURCE_NOT_FOUND == status.getCode()) {
return object;
}
}
logger.error("Error in demandLoadResource for " + getURI(), ioe);
return object;
}
}