Ejemplo n.º 1
0
 /// <summary>
 /// Copy a file or folder in the cache
 /// </summary>
 /// <param name="sourceCache"></param>
 /// <param name="sourceEntry"></param>
 /// <param name="targetPath"></param>
 public void copyFromCache(ICache sourceCache, ICacheEntry sourceEntry, string targetPath)
 {
     this.put(targetPath, this.cacheEntryToArray(sourceEntry));
     if (sourceEntry.getMimeType() == sourceEntry.DIRECTORY_MIMETYPE)
     {
         var folderContent = sourceCache.getFolderContentsById(sourceEntry.getId());
         foreach (var subEntry in folderContent)
         {
             var subTargetPath = targetPath + "/" + subEntry.getName();
             this.copyFromCache(sourceCache, subEntry, subTargetPath);
         }
     }
 }