diff options
author | Melanie Thielker | 2009-05-09 02:49:55 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-05-09 02:49:55 +0000 |
commit | c1e7352d75b62b6c97e79c4fdb37b9493aba697a (patch) | |
tree | 0bf2e2b12fafc2fc08dce9c50a0fa198b787979c /OpenSim/Servers/Asset/AssetServerConnector.cs | |
parent | FInish basic asset server functionality on the new asset server (diff) | |
download | opensim-SC_OLD-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.zip opensim-SC_OLD-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.tar.gz opensim-SC_OLD-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.tar.bz2 opensim-SC_OLD-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.tar.xz |
Add the asset service connectors and sample config. READ WARNINGS!!!
Diffstat (limited to 'OpenSim/Servers/Asset/AssetServerConnector.cs')
-rw-r--r-- | OpenSim/Servers/Asset/AssetServerConnector.cs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/OpenSim/Servers/Asset/AssetServerConnector.cs b/OpenSim/Servers/Asset/AssetServerConnector.cs index c9d2300..32e27c5 100644 --- a/OpenSim/Servers/Asset/AssetServerConnector.cs +++ b/OpenSim/Servers/Asset/AssetServerConnector.cs | |||
@@ -25,9 +25,10 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
28 | using Nini.Config; | 29 | using Nini.Config; |
30 | using OpenSim.Servers.Base; | ||
29 | using OpenSim.Services.Interfaces; | 31 | using OpenSim.Services.Interfaces; |
30 | using OpenSim.Services.AssetService; | ||
31 | using OpenSim.Framework.Servers.HttpServer; | 32 | using OpenSim.Framework.Servers.HttpServer; |
32 | 33 | ||
33 | namespace OpenSim.Servers.AssetServer | 34 | namespace OpenSim.Servers.AssetServer |
@@ -38,9 +39,23 @@ namespace OpenSim.Servers.AssetServer | |||
38 | 39 | ||
39 | public AssetServiceConnector(IConfigSource config, IHttpServer server) | 40 | public AssetServiceConnector(IConfigSource config, IHttpServer server) |
40 | { | 41 | { |
41 | m_AssetService = new AssetService(config); | 42 | IConfig serverConfig = config.Configs["AssetService"]; |
43 | if (serverConfig == null) | ||
44 | throw new Exception("No section 'Server' in config file"); | ||
45 | |||
46 | string assetService = serverConfig.GetString("Module", | ||
47 | String.Empty); | ||
48 | |||
49 | if (assetService == String.Empty) | ||
50 | throw new Exception("No AssetService in config file"); | ||
51 | |||
52 | Object[] args = new Object[] { config }; | ||
53 | m_AssetService = | ||
54 | ServerUtils.LoadPlugin<IAssetService>(assetService, args); | ||
42 | 55 | ||
43 | server.AddStreamHandler(new AssetServerGetHandler(m_AssetService)); | 56 | server.AddStreamHandler(new AssetServerGetHandler(m_AssetService)); |
57 | server.AddStreamHandler(new AssetServerPostHandler(m_AssetService)); | ||
58 | server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService)); | ||
44 | } | 59 | } |
45 | } | 60 | } |
46 | } | 61 | } |