aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs21
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs5
2 files changed, 19 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 2090558..b61b524 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -222,6 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
222 item.Creator = m_userInfo.UserProfile.ID; 222 item.Creator = m_userInfo.UserProfile.ID;
223 item.Owner = m_userInfo.UserProfile.ID; 223 item.Owner = m_userInfo.UserProfile.ID;
224 224
225 /*
225 filePath = filePath.Substring(InventoryArchiveConstants.INVENTORY_PATH.Length); 226 filePath = filePath.Substring(InventoryArchiveConstants.INVENTORY_PATH.Length);
226 string[] rawFolders = filePath.Split(new char[] { '/' }); 227 string[] rawFolders = filePath.Split(new char[] { '/' });
227 228
@@ -231,23 +232,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
231 InventoryFolderImpl foundFolder = rootDestinationFolder; 232 InventoryFolderImpl foundFolder = rootDestinationFolder;
232 while (!noFolder && i < rawFolders.Length) 233 while (!noFolder && i < rawFolders.Length)
233 { 234 {
234 foundFolder = foundFolder.FindFolderByPath(rawFolders[i]); 235 InventoryFolderImpl folder = foundFolder.FindFolderByPath(rawFolders[i]);
235 if (null == foundFolder) 236 if (null != folder)
236 noFolder = true; 237 {
237 else 238 m_log.DebugFormat("[INVENTORY ARCHIVER]: Found folder {0}", folder.Name);
239 foundFolder = folder;
238 i++; 240 i++;
241 }
242 else
243 {
244 noFolder = true;
245 }
239 } 246 }
240 247
241 // Create any folders that did not previously exist 248 // Create any folders that did not previously exist
242 while (i < rawFolders.Length) 249 while (i < rawFolders.Length)
243 { 250 {
244 foundFolder.CreateChildFolder(UUID.Random(), rawFolders[i++], (ushort)AssetType.Folder); 251 m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0}", rawFolders[i]);
252 foundFolder.CreateChildFolder(UUID.Random(), rawFolders[i++], (ushort)AssetType.Folder);
245 } 253 }
246 254
247 // Reset folder ID to the one in which we want to load it 255 // Reset folder ID to the one in which we want to load it
248 // TODO: Properly restore entire folder structure. At the moment all items are dumped in this 256 // TODO: Properly restore entire folder structure. At the moment all items are dumped in this
249 // single folder no matter where in the saved folder structure they are. 257 // single folder no matter where in the saved folder structure they are.
250 item.Folder = foundFolder.ID; 258 item.Folder = foundFolder.ID;
259 */
260
261 item.Folder = rootDestinationFolder.ID;
251 262
252 m_userInfo.AddItem(item); 263 m_userInfo.AddItem(item);
253 successfulItemRestores++; 264 successfulItemRestores++;
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index dafce81..cb613f7 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -128,7 +128,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
128 bool gotObject1File = false; 128 bool gotObject1File = false;
129 //bool gotObject2File = false; 129 //bool gotObject2File = false;
130 string expectedObject1FilePath = string.Format( 130 string expectedObject1FilePath = string.Format(
131 "{0}{1}_{2}.xml", 131 "{0}{1}{2}_{3}.xml",
132 InventoryArchiveConstants.INVENTORY_PATH,
132 "Objects/", 133 "Objects/",
133 item1.Name, 134 item1.Name,
134 item1Id); 135 item1Id);
@@ -151,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
151 gotControlFile = true; 152 gotControlFile = true;
152 } 153 }
153 */ 154 */
154 if (filePath.StartsWith("Objects/") && filePath.EndsWith(".xml")) 155 if (filePath.StartsWith(InventoryArchiveConstants.INVENTORY_PATH) && filePath.EndsWith(".xml"))
155 { 156 {
156 //string fileName = filePath.Remove(0, "Objects/".Length); 157 //string fileName = filePath.Remove(0, "Objects/".Length);
157 158