aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs46
1 files changed, 23 insertions, 23 deletions
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
index c8cec69..0fbc427 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Framework.Communications.Cache
36 public class InventoryFolderImpl : InventoryFolderBase 36 public class InventoryFolderImpl : InventoryFolderBase
37 { 37 {
38 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 38 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
39 39
40 // Fields 40 // Fields
41 public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); 41 public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>();
42 public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>(); 42 public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>();
@@ -82,14 +82,14 @@ namespace OpenSim.Framework.Communications.Cache
82 subFold.ParentID = this.ID; 82 subFold.ParentID = this.ID;
83 subFold.Owner = Owner; 83 subFold.Owner = Owner;
84 SubFolders.Add(subFold.ID, subFold); 84 SubFolders.Add(subFold.ID, subFold);
85 85
86 return subFold; 86 return subFold;
87 } 87 }
88 } 88 }
89 89
90 return null; 90 return null;
91 } 91 }
92 92
93 /// <summary> 93 /// <summary>
94 /// Delete all the folders and items in this folder. 94 /// Delete all the folders and items in this folder.
95 /// </summary> 95 /// </summary>
@@ -97,9 +97,9 @@ namespace OpenSim.Framework.Communications.Cache
97 { 97 {
98 foreach (InventoryFolderImpl folder in SubFolders.Values) 98 foreach (InventoryFolderImpl folder in SubFolders.Values)
99 { 99 {
100 folder.Purge(); 100 folder.Purge();
101 } 101 }
102 102
103 SubFolders.Clear(); 103 SubFolders.Clear();
104 Items.Clear(); 104 Items.Clear();
105 } 105 }
@@ -118,20 +118,20 @@ namespace OpenSim.Framework.Communications.Cache
118 return Items[itemID]; 118 return Items[itemID];
119 } 119 }
120 } 120 }
121 121
122 lock (SubFolders) 122 lock (SubFolders)
123 { 123 {
124 foreach (InventoryFolderImpl folder in SubFolders.Values) 124 foreach (InventoryFolderImpl folder in SubFolders.Values)
125 { 125 {
126 InventoryItemBase item = folder.FindItem(itemID); 126 InventoryItemBase item = folder.FindItem(itemID);
127 127
128 if (item != null) 128 if (item != null)
129 { 129 {
130 return item; 130 return item;
131 } 131 }
132 } 132 }
133 } 133 }
134 134
135 return null; 135 return null;
136 } 136 }
137 137
@@ -143,7 +143,7 @@ namespace OpenSim.Framework.Communications.Cache
143 public bool DeleteItem(LLUUID itemID) 143 public bool DeleteItem(LLUUID itemID)
144 { 144 {
145 bool found = false; 145 bool found = false;
146 146
147 lock (Items) 147 lock (Items)
148 { 148 {
149 if (Items.ContainsKey(itemID)) 149 if (Items.ContainsKey(itemID))
@@ -152,20 +152,20 @@ namespace OpenSim.Framework.Communications.Cache
152 return true; 152 return true;
153 } 153 }
154 } 154 }
155 155
156 lock (SubFolders) 156 lock (SubFolders)
157 { 157 {
158 foreach (InventoryFolderImpl folder in SubFolders.Values) 158 foreach (InventoryFolderImpl folder in SubFolders.Values)
159 { 159 {
160 found = folder.DeleteItem(itemID); 160 found = folder.DeleteItem(itemID);
161 161
162 if (found == true) 162 if (found == true)
163 { 163 {
164 break; 164 break;
165 } 165 }
166 } 166 }
167 } 167 }
168 168
169 return found; 169 return found;
170 } 170 }
171 171
@@ -175,25 +175,25 @@ namespace OpenSim.Framework.Communications.Cache
175 /// </summary> 175 /// </summary>
176 /// <returns>The requested folder if it exists, null if it does not.</returns> 176 /// <returns>The requested folder if it exists, null if it does not.</returns>
177 public InventoryFolderImpl FindFolder(LLUUID folderID) 177 public InventoryFolderImpl FindFolder(LLUUID folderID)
178 { 178 {
179 if (folderID == ID) 179 if (folderID == ID)
180 { 180 {
181 return this; 181 return this;
182 } 182 }
183 183
184 lock (SubFolders) 184 lock (SubFolders)
185 { 185 {
186 foreach (InventoryFolderImpl folder in SubFolders.Values) 186 foreach (InventoryFolderImpl folder in SubFolders.Values)
187 { 187 {
188 InventoryFolderImpl returnFolder = folder.FindFolder(folderID); 188 InventoryFolderImpl returnFolder = folder.FindFolder(folderID);
189 189
190 if (returnFolder != null) 190 if (returnFolder != null)
191 { 191 {
192 return returnFolder; 192 return returnFolder;
193 } 193 }
194 } 194 }
195 } 195 }
196 196
197 return null; 197 return null;
198 } 198 }
199 199
@@ -203,7 +203,7 @@ namespace OpenSim.Framework.Communications.Cache
203 public List<InventoryItemBase> RequestListOfItems() 203 public List<InventoryItemBase> RequestListOfItems()
204 { 204 {
205 List<InventoryItemBase> itemList = new List<InventoryItemBase>(); 205 List<InventoryItemBase> itemList = new List<InventoryItemBase>();
206 206
207 lock (Items) 207 lock (Items)
208 { 208 {
209 foreach (InventoryItemBase item in Items.Values) 209 foreach (InventoryItemBase item in Items.Values)
@@ -211,9 +211,9 @@ namespace OpenSim.Framework.Communications.Cache
211 itemList.Add(item); 211 itemList.Add(item);
212 } 212 }
213 } 213 }
214 214
215 //m_log.DebugFormat("[INVENTORY FOLDER IMPL]: Found {0} items", itemList.Count); 215 //m_log.DebugFormat("[INVENTORY FOLDER IMPL]: Found {0} items", itemList.Count);
216 216
217 return itemList; 217 return itemList;
218 } 218 }
219 219
@@ -221,9 +221,9 @@ namespace OpenSim.Framework.Communications.Cache
221 /// Return the list of immediate child folders in this folder. 221 /// Return the list of immediate child folders in this folder.
222 /// </summary> 222 /// </summary>
223 public List<InventoryFolderBase> RequestListOfFolders() 223 public List<InventoryFolderBase> RequestListOfFolders()
224 { 224 {
225 List<InventoryFolderBase> folderList = new List<InventoryFolderBase>(); 225 List<InventoryFolderBase> folderList = new List<InventoryFolderBase>();
226 226
227 lock (SubFolders) 227 lock (SubFolders)
228 { 228 {
229 foreach (InventoryFolderBase folder in SubFolders.Values) 229 foreach (InventoryFolderBase folder in SubFolders.Values)
@@ -231,7 +231,7 @@ namespace OpenSim.Framework.Communications.Cache
231 folderList.Add(folder); 231 folderList.Add(folder);
232 } 232 }
233 } 233 }
234 234
235 return folderList; 235 return folderList;
236 } 236 }
237 } 237 }