public void move(String oldPath, String newPath) { bool wasDir = backingProvider.isDirectory(oldPath); backingProvider.move(oldPath, newPath); if (wasDir) { copyCachedResourcesToBackingProvider(ResourceCache.getResourcesInDirectory(oldPath), oldPath, newPath); ResourceCache.forceCloseResourcesInDirectroy(oldPath); } else { var cachedResource = ResourceCache[oldPath]; if (cachedResource != null) { using (Stream writeStream = backingProvider.openWriteStream(newPath)) { using (Stream readStream = cachedResource.openStream()) { readStream.CopyTo(writeStream); } } } ResourceCache.forceCloseResourceFile(oldPath); } }
public void copyDirectory(string from, string to) { backingProvider.copyDirectory(from, to); copyCachedResourcesToBackingProvider(ResourceCache.getResourcesInDirectory(from), from, to); }