aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Asset
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Handlers/Asset')
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerConnector.cs9
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs7
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs9
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs7
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetsExistHandler.cs7
5 files changed, 35 insertions, 4 deletions
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
index 9b86986..df9a51b 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
@@ -30,6 +30,7 @@ using System.IO;
30using Nini.Config; 30using Nini.Config;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.ServiceAuth;
33using OpenSim.Framework.Console; 34using OpenSim.Framework.Console;
34using OpenSim.Server.Base; 35using OpenSim.Server.Base;
35using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
@@ -83,9 +84,11 @@ namespace OpenSim.Server.Handlers.Asset
83 allowedRemoteDeleteTypes = AllowedRemoteDeleteTypes.MapTile; 84 allowedRemoteDeleteTypes = AllowedRemoteDeleteTypes.MapTile;
84 } 85 }
85 86
86 server.AddStreamHandler(new AssetServerGetHandler(m_AssetService)); 87 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
87 server.AddStreamHandler(new AssetServerPostHandler(m_AssetService)); 88
88 server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowedRemoteDeleteTypes)); 89 server.AddStreamHandler(new AssetServerGetHandler(m_AssetService, auth));
90 server.AddStreamHandler(new AssetServerPostHandler(m_AssetService, auth));
91 server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowedRemoteDeleteTypes, auth));
89 server.AddStreamHandler(new AssetsExistHandler(m_AssetService)); 92 server.AddStreamHandler(new AssetsExistHandler(m_AssetService));
90 93
91 MainConsole.Instance.Commands.AddCommand("Assets", false, 94 MainConsole.Instance.Commands.AddCommand("Assets", false,
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
index 941b97d..d85d471 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
@@ -38,6 +38,7 @@ using System.Xml.Serialization;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42 43
43namespace OpenSim.Server.Handlers.Asset 44namespace OpenSim.Server.Handlers.Asset
@@ -70,6 +71,12 @@ namespace OpenSim.Server.Handlers.Asset
70 m_allowedTypes = allowedTypes; 71 m_allowedTypes = allowedTypes;
71 } 72 }
72 73
74 public AssetServerDeleteHandler(IAssetService service, AllowedRemoteDeleteTypes allowedTypes, IServiceAuth auth) :
75 base("DELETE", "/assets", auth)
76 {
77 m_AssetService = service;
78 m_allowedTypes = allowedTypes;
79 }
73 protected override byte[] ProcessRequest(string path, Stream request, 80 protected override byte[] ProcessRequest(string path, Stream request,
74 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 81 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
75 { 82 {
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
index ed3b4af..500ec50 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
@@ -38,19 +38,26 @@ using System.Xml.Serialization;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42 43
43namespace OpenSim.Server.Handlers.Asset 44namespace OpenSim.Server.Handlers.Asset
44{ 45{
45 public class AssetServerGetHandler : BaseStreamHandler 46 public class AssetServerGetHandler : BaseStreamHandler
46 { 47 {
47 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 49
49 private IAssetService m_AssetService; 50 private IAssetService m_AssetService;
50 51
51 public AssetServerGetHandler(IAssetService service) : 52 public AssetServerGetHandler(IAssetService service) :
52 base("GET", "/assets") 53 base("GET", "/assets")
53 { 54 {
55 m_AssetService = service;
56 }
57
58 public AssetServerGetHandler(IAssetService service, IServiceAuth auth) :
59 base("GET", "/assets", auth)
60 {
54 m_AssetService = service; 61 m_AssetService = service;
55 } 62 }
56 63
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs
index a77e67d..1c706a7 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs
@@ -38,6 +38,7 @@ using System.Xml.Serialization;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42 43
43namespace OpenSim.Server.Handlers.Asset 44namespace OpenSim.Server.Handlers.Asset
@@ -54,6 +55,12 @@ namespace OpenSim.Server.Handlers.Asset
54 m_AssetService = service; 55 m_AssetService = service;
55 } 56 }
56 57
58 public AssetServerPostHandler(IAssetService service, IServiceAuth auth) :
59 base("POST", "/assets", auth)
60 {
61 m_AssetService = service;
62 }
63
57 protected override byte[] ProcessRequest(string path, Stream request, 64 protected override byte[] ProcessRequest(string path, Stream request,
58 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 65 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
59 { 66 {
diff --git a/OpenSim/Server/Handlers/Asset/AssetsExistHandler.cs b/OpenSim/Server/Handlers/Asset/AssetsExistHandler.cs
index 6d01f86..32901b3 100644
--- a/OpenSim/Server/Handlers/Asset/AssetsExistHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetsExistHandler.cs
@@ -38,6 +38,7 @@ using System.Xml.Serialization;
38using OpenSim.Server.Base; 38using OpenSim.Server.Base;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using OpenSim.Framework; 40using OpenSim.Framework;
41using OpenSim.Framework.ServiceAuth;
41using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
42using OpenMetaverse; 43using OpenMetaverse;
43 44
@@ -55,6 +56,12 @@ namespace OpenSim.Server.Handlers.Asset
55 m_AssetService = service; 56 m_AssetService = service;
56 } 57 }
57 58
59 public AssetsExistHandler(IAssetService service, IServiceAuth auth) :
60 base("POST", "/get_assets_exist", auth)
61 {
62 m_AssetService = service;
63 }
64
58 protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 65 protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
59 { 66 {
60 XmlSerializer xs; 67 XmlSerializer xs;