From 36a40e0295e7c9a60ad4a5047eca9d20df94397f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 8 Sep 2009 16:29:31 +0100 Subject: refactor: change method argument name --- .../Archiver/InventoryArchiveReadRequest.cs | 46 +++++++++++----------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index ff583e5..3250ddf 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// /// Replicate the inventory paths in the archive to the user's inventory as necessary. /// - /// + /// The item archive path to replicate /// Is the path we're dealing with a directory? /// The root folder for the inventory load /// @@ -218,49 +218,51 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// /// The last user inventory folder created or found for the archive path public InventoryFolderBase ReplicateArchivePathToUserInventory( - string fsPath, + string archivePath, bool isDir, InventoryFolderBase rootDestFolder, Dictionary foldersCreated, List nodesLoaded) { - fsPath = fsPath.Substring(ArchiveConstants.INVENTORY_PATH.Length); + archivePath = archivePath.Substring(ArchiveConstants.INVENTORY_PATH.Length); // Remove the file portion if we aren't already dealing with a directory path if (!isDir) - fsPath = fsPath.Remove(fsPath.LastIndexOf("/") + 1); + archivePath = archivePath.Remove(archivePath.LastIndexOf("/") + 1); - string originalFsPath = fsPath; + string originalArchivePath = archivePath; - m_log.DebugFormat("[INVENTORY ARCHIVER]: Loading to folder {0}", fsPath); + m_log.DebugFormat( + "[INVENTORY ARCHIVER]: Loading to folder {0 {1}}", rootDestFolder.Name, rootDestFolder.ID); InventoryFolderBase destFolder = null; // XXX: Nasty way of dealing with a path that has no directory component - if (fsPath.Length > 0) + if (archivePath.Length > 0) { - while (null == destFolder && fsPath.Length > 0) + while (null == destFolder && archivePath.Length > 0) { - if (foldersCreated.ContainsKey(fsPath)) + if (foldersCreated.ContainsKey(archivePath)) { - m_log.DebugFormat("[INVENTORY ARCHIVER]: Found previously created fs path {0}", fsPath); - destFolder = foldersCreated[fsPath]; + m_log.DebugFormat( + "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath); + destFolder = foldersCreated[archivePath]; } else { // Don't include the last slash - int penultimateSlashIndex = fsPath.LastIndexOf("/", fsPath.Length - 2); + int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2); if (penultimateSlashIndex >= 0) { - fsPath = fsPath.Remove(penultimateSlashIndex + 1); + archivePath = archivePath.Remove(penultimateSlashIndex + 1); } else { m_log.DebugFormat( - "[INVENTORY ARCHIVER]: Found no previously created fs path for {0}", - originalFsPath); - fsPath = string.Empty; + "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}", + originalArchivePath); + archivePath = string.Empty; destFolder = rootDestFolder; } } @@ -271,14 +273,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver destFolder = rootDestFolder; } - string fsPathSectionToCreate = originalFsPath.Substring(fsPath.Length); + string archivePathSectionToCreate = originalArchivePath.Substring(archivePath.Length); string[] rawDirsToCreate - = fsPathSectionToCreate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + = archivePathSectionToCreate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); int i = 0; while (i < rawDirsToCreate.Length) { - m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0}", rawDirsToCreate[i]); + m_log.DebugFormat("[INVENTORY ARCHIVER]: Loading archived folder {0}", rawDirsToCreate[i]); int identicalNameIdentifierIndex = rawDirsToCreate[i].LastIndexOf( @@ -305,9 +307,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // foundFolder.Name, foundFolder.ID); // Record that we have now created this folder - fsPath += rawDirsToCreate[i] + "/"; - m_log.DebugFormat("[INVENTORY ARCHIVER]: Recording creation of fs path {0}", fsPath); - foldersCreated[fsPath] = destFolder; + archivePath += rawDirsToCreate[i] + "/"; + m_log.DebugFormat("[INVENTORY ARCHIVER]: Loaded archive path {0}", archivePath); + foldersCreated[archivePath] = destFolder; if (0 == i) nodesLoaded.Add(destFolder); -- cgit v1.1