diff options
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r-- | OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs index e33145f..03215f2 100644 --- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs | |||
@@ -26,8 +26,10 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | ||
29 | using OpenMetaverse; | 30 | using OpenMetaverse; |
30 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; | ||
31 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
32 | using OpenSim.Services.Interfaces; | 34 | using OpenSim.Services.Interfaces; |
33 | 35 | ||
@@ -118,5 +120,24 @@ namespace OpenSim.Tests.Common | |||
118 | else | 120 | else |
119 | return newFolder; | 121 | return newFolder; |
120 | } | 122 | } |
123 | |||
124 | /// <summary> | ||
125 | /// Get the inventory folder that matches the path name. If there are multiple folders then only the first | ||
126 | /// is returned. | ||
127 | /// </summary> | ||
128 | /// <param name="inventoryService"></param> | ||
129 | /// <param name="userId"></param> | ||
130 | /// <param name="path"></param> | ||
131 | /// <returns>null if no folder matching the path was found</returns> | ||
132 | public static InventoryFolderBase GetInventoryFolder(IInventoryService inventoryService, UUID userId, string path) | ||
133 | { | ||
134 | List<InventoryFolderBase> folders | ||
135 | = InventoryArchiveUtils.FindFolderByPath(inventoryService, userId, path); | ||
136 | |||
137 | if (folders.Count != 0) | ||
138 | return folders[0]; | ||
139 | else | ||
140 | return null; | ||
141 | } | ||
121 | } | 142 | } |
122 | } \ No newline at end of file | 143 | } \ No newline at end of file |