aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Servers/Asset/AssetServerConnector.cs
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-09 02:49:55 +0000
committerMelanie Thielker2009-05-09 02:49:55 +0000
commitc1e7352d75b62b6c97e79c4fdb37b9493aba697a (patch)
tree0bf2e2b12fafc2fc08dce9c50a0fa198b787979c /OpenSim/Servers/Asset/AssetServerConnector.cs
parentFInish basic asset server functionality on the new asset server (diff)
downloadopensim-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.cs19
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
28using System;
28using Nini.Config; 29using Nini.Config;
30using OpenSim.Servers.Base;
29using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
30using OpenSim.Services.AssetService;
31using OpenSim.Framework.Servers.HttpServer; 32using OpenSim.Framework.Servers.HttpServer;
32 33
33namespace OpenSim.Servers.AssetServer 34namespace 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}