diff options
author | Justin Clarke Casey | 2009-02-18 19:26:10 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-18 19:26:10 +0000 |
commit | 5e4cad07eb2cac6671ca86ac19d01f6a882c827d (patch) | |
tree | 929e38f3042661b44031c83a4591760d87daeb49 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |
parent | Fix estate ban list persistence in MySQL and reenable tests (diff) | |
download | opensim-SC_OLD-5e4cad07eb2cac6671ca86ac19d01f6a882c827d.zip opensim-SC_OLD-5e4cad07eb2cac6671ca86ac19d01f6a882c827d.tar.gz opensim-SC_OLD-5e4cad07eb2cac6671ca86ac19d01f6a882c827d.tar.bz2 opensim-SC_OLD-5e4cad07eb2cac6671ca86ac19d01f6a882c827d.tar.xz |
* Make save iar behave properly if the nominated inventory path does not exist
* load iar probably still fails for this
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index be700e9..1152a1e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -95,6 +95,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
95 | } | 95 | } |
96 | catch (IOException e) | 96 | catch (IOException e) |
97 | { | 97 | { |
98 | m_saveStream.Close(); | ||
98 | reportedException = e; | 99 | reportedException = e; |
99 | succeeded = false; | 100 | succeeded = false; |
100 | } | 101 | } |
@@ -104,9 +105,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
104 | 105 | ||
105 | protected void saveInvItem(InventoryItemBase inventoryItem, string path) | 106 | protected void saveInvItem(InventoryItemBase inventoryItem, string path) |
106 | { | 107 | { |
107 | string filename | 108 | string filename = string.Format("{0}{1}_{2}.xml", path, inventoryItem.Name, inventoryItem.ID); |
108 | = string.Format("{0}{1}_{2}.xml", | ||
109 | path, inventoryItem.Name, inventoryItem.ID); | ||
110 | StringWriter sw = new StringWriter(); | 109 | StringWriter sw = new StringWriter(); |
111 | XmlTextWriter writer = new XmlTextWriter(sw); | 110 | XmlTextWriter writer = new XmlTextWriter(sw); |
112 | writer.Formatting = Formatting.Indented; | 111 | writer.Formatting = Formatting.Indented; |
@@ -182,6 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
182 | List<InventoryItemBase> items = inventoryFolder.RequestListOfItems(); | 181 | List<InventoryItemBase> items = inventoryFolder.RequestListOfItems(); |
183 | string newPath = path + inventoryFolder.Name + InventoryFolderImpl.PATH_DELIMITER; | 182 | string newPath = path + inventoryFolder.Name + InventoryFolderImpl.PATH_DELIMITER; |
184 | archive.AddDir(newPath); | 183 | archive.AddDir(newPath); |
184 | |||
185 | foreach (InventoryFolderImpl folder in inventories) | 185 | foreach (InventoryFolderImpl folder in inventories) |
186 | { | 186 | { |
187 | saveInvDir(folder, newPath); | 187 | saveInvDir(folder, newPath); |
@@ -192,6 +192,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
192 | } | 192 | } |
193 | } | 193 | } |
194 | 194 | ||
195 | /// <summary> | ||
196 | /// Execute the inventory write request | ||
197 | /// </summary> | ||
195 | public void Execute() | 198 | public void Execute() |
196 | { | 199 | { |
197 | InventoryFolderImpl inventoryFolder = null; | 200 | InventoryFolderImpl inventoryFolder = null; |
@@ -251,7 +254,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
251 | { | 254 | { |
252 | if (null == inventoryItem) | 255 | if (null == inventoryItem) |
253 | { | 256 | { |
254 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not find inventory entry at path {0}", m_invPath); | 257 | m_saveStream.Close(); |
258 | m_module.TriggerInventoryArchiveSaved( | ||
259 | false, m_userInfo, m_invPath, m_saveStream, | ||
260 | new Exception(string.Format("Could not find inventory entry at path {0}", m_invPath))); | ||
255 | return; | 261 | return; |
256 | } | 262 | } |
257 | else | 263 | else |