aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-06-18 17:10:16 +0100
committerJustin Clark-Casey (justincc)2010-06-18 17:10:16 +0100
commit11a35d8cdaac00ac563c2f44fdb28342ca95e142 (patch)
tree394d68e759047d124983fa0e91f9a3878030f354 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
parentin IAR utils, return all folders that match a particular path rather than jus... (diff)
downloadopensim-SC_OLD-11a35d8cdaac00ac563c2f44fdb28342ca95e142.zip
opensim-SC_OLD-11a35d8cdaac00ac563c2f44fdb28342ca95e142.tar.gz
opensim-SC_OLD-11a35d8cdaac00ac563c2f44fdb28342ca95e142.tar.bz2
opensim-SC_OLD-11a35d8cdaac00ac563c2f44fdb28342ca95e142.tar.xz
change TestPartExistingIarPath() to check appropriate folder creation
change some names in InventoryArchiveReadRequest in an effort to make the code more comprehendable
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs39
1 files changed, 22 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 29e992e..94c6ef9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -189,7 +189,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
189 /// <summary> 189 /// <summary>
190 /// Replicate the inventory paths in the archive to the user's inventory as necessary. 190 /// Replicate the inventory paths in the archive to the user's inventory as necessary.
191 /// </summary> 191 /// </summary>
192 /// <param name="archivePath">The item archive path to replicate</param> 192 /// <param name="iarPath">The item archive path to replicate</param>
193 /// <param name="rootDestinationFolder">The root folder for the inventory load</param> 193 /// <param name="rootDestinationFolder">The root folder for the inventory load</param>
194 /// <param name="resolvedFolders"> 194 /// <param name="resolvedFolders">
195 /// The folders that we have resolved so far for a given archive path. 195 /// The folders that we have resolved so far for a given archive path.
@@ -200,24 +200,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
200 /// </param> 200 /// </param>
201 /// <returns>The last user inventory folder created or found for the archive path</returns> 201 /// <returns>The last user inventory folder created or found for the archive path</returns>
202 public InventoryFolderBase ReplicateArchivePathToUserInventory( 202 public InventoryFolderBase ReplicateArchivePathToUserInventory(
203 string archivePath, 203 string iarPath,
204 InventoryFolderBase rootDestFolder, 204 InventoryFolderBase rootDestFolder,
205 Dictionary <string, InventoryFolderBase> resolvedFolders, 205 Dictionary <string, InventoryFolderBase> resolvedFolders,
206 List<InventoryNodeBase> loadedNodes) 206 List<InventoryNodeBase> loadedNodes)
207 { 207 {
208 string originalArchivePath = archivePath; 208 string iarPathExisting = iarPath;
209 209
210// m_log.DebugFormat( 210// m_log.DebugFormat(
211// "[INVENTORY ARCHIVER]: Loading folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID); 211// "[INVENTORY ARCHIVER]: Loading folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID);
212 212
213 InventoryFolderBase destFolder = ResolveDestinationFolder(rootDestFolder, ref archivePath, resolvedFolders); 213 InventoryFolderBase destFolder = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders);
214 214
215// m_log.DebugFormat( 215 m_log.DebugFormat(
216// "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", 216 "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]",
217// originalArchivePath, archivePath); 217 iarPath, iarPathExisting);
218 218
219 string archivePathSectionToCreate = originalArchivePath.Substring(archivePath.Length); 219 string iarPathToCreate = iarPath.Substring(iarPathExisting.Length);
220 CreateFoldersForPath(destFolder, archivePathSectionToCreate, resolvedFolders, loadedNodes); 220 CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes);
221 221
222 return destFolder; 222 return destFolder;
223 } 223 }
@@ -297,8 +297,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
297 /// <param name="destFolder"> 297 /// <param name="destFolder">
298 /// The root folder from which the creation will take place. 298 /// The root folder from which the creation will take place.
299 /// </param> 299 /// </param>
300 /// <param name="path"> 300 /// <param name="iarPathExisting">
301 /// The path to create 301 /// the part of the iar path that already exists
302 /// </param>
303 /// <param name="iarPathToReplicate">
304 /// The path to replicate in the user's inventory from iar
302 /// </param> 305 /// </param>
303 /// <param name="resolvedFolders"> 306 /// <param name="resolvedFolders">
304 /// The folders that we have resolved so far for a given archive path. 307 /// The folders that we have resolved so far for a given archive path.
@@ -307,11 +310,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
307 /// Track the inventory nodes created. 310 /// Track the inventory nodes created.
308 /// </param> 311 /// </param>
309 protected void CreateFoldersForPath( 312 protected void CreateFoldersForPath(
310 InventoryFolderBase destFolder, string path, Dictionary <string, InventoryFolderBase> resolvedFolders, 313 InventoryFolderBase destFolder,
314 string iarPathExisting,
315 string iarPathToReplicate,
316 Dictionary <string, InventoryFolderBase> resolvedFolders,
311 List<InventoryNodeBase> loadedNodes) 317 List<InventoryNodeBase> loadedNodes)
312 { 318 {
313 string pathCreated = ""; 319 string[] rawDirsToCreate = iarPathToReplicate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
314 string[] rawDirsToCreate = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
315 int i = 0; 320 int i = 0;
316 321
317 while (i < rawDirsToCreate.Length) 322 while (i < rawDirsToCreate.Length)
@@ -343,9 +348,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
343 m_scene.InventoryService.AddFolder(destFolder); 348 m_scene.InventoryService.AddFolder(destFolder);
344 349
345 // Record that we have now created this folder 350 // Record that we have now created this folder
346 pathCreated += rawDirsToCreate[i] + "/"; 351 iarPathExisting += rawDirsToCreate[i] + "/";
347 m_log.DebugFormat("[INVENTORY ARCHIVER]: Created folder {0} from IAR", pathCreated); 352 m_log.DebugFormat("[INVENTORY ARCHIVER]: Created folder {0} from IAR", iarPathExisting);
348 resolvedFolders[pathCreated] = destFolder; 353 resolvedFolders[iarPathExisting] = destFolder;
349 354
350 if (0 == i) 355 if (0 == i)
351 loadedNodes.Add(destFolder); 356 loadedNodes.Add(destFolder);