diff options
Diffstat (limited to 'bundles/org.eclipse.core.resources.semantic/src/org/eclipse/core/internal/resources/semantic/cacheservice/CacheService.java')
-rw-r--r-- | bundles/org.eclipse.core.resources.semantic/src/org/eclipse/core/internal/resources/semantic/cacheservice/CacheService.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/bundles/org.eclipse.core.resources.semantic/src/org/eclipse/core/internal/resources/semantic/cacheservice/CacheService.java b/bundles/org.eclipse.core.resources.semantic/src/org/eclipse/core/internal/resources/semantic/cacheservice/CacheService.java index 3aa84f7..7529493 100644 --- a/bundles/org.eclipse.core.resources.semantic/src/org/eclipse/core/internal/resources/semantic/cacheservice/CacheService.java +++ b/bundles/org.eclipse.core.resources.semantic/src/org/eclipse/core/internal/resources/semantic/cacheservice/CacheService.java @@ -124,6 +124,40 @@ public class CacheService implements ICacheService { } } + public void moveContent(IPath path, IPath targetPath, IProgressMonitor monitor) throws CoreException { + if (SfsSpiTraceLocation.CACHESERVICE.isActive()) { + SfsSpiTraceLocation.getTrace().traceEntry(SfsSpiTraceLocation.CACHESERVICE.getLocation(), path.toString()); + } + + try { + lockForWrite(); + + InputStream input = getContent(path); + + if (input != null) { + try { + addContent(targetPath, input, 0, monitor); + } finally { + if (input != null) { + try { + input.close(); + } catch (IOException e) { + // ignore + } + } + } + } + + ICachedContentHandle cacheFile = createCacheContentHandle(path); + + if (cacheFile.exists()) { + cacheFile.delete(); + } + } finally { + unlockForWrite(); + } + } + public boolean hasContent(IPath path) throws CoreException { if (SfsSpiTraceLocation.CACHESERVICE.isActive()) { |