diff options
author | lbsa71 | 2009-05-06 17:02:51 +0000 |
---|---|---|
committer | lbsa71 | 2009-05-06 17:02:51 +0000 |
commit | 1afdf2ee1fda020926d85f2763617b0bace5d03a (patch) | |
tree | a41a85656d8dd3a185adf55f3f09473dcb758b1f /OpenSim/Framework/Servers/GetAssetStreamHandler.cs | |
parent | Thank you kindly, Fly-Man- for a patch that: (diff) | |
download | opensim-SC_OLD-1afdf2ee1fda020926d85f2763617b0bace5d03a.zip opensim-SC_OLD-1afdf2ee1fda020926d85f2763617b0bace5d03a.tar.gz opensim-SC_OLD-1afdf2ee1fda020926d85f2763617b0bace5d03a.tar.bz2 opensim-SC_OLD-1afdf2ee1fda020926d85f2763617b0bace5d03a.tar.xz |
* Added some GetAssetStreamHandlerTests
* Minor tweaks to attain testability
Diffstat (limited to 'OpenSim/Framework/Servers/GetAssetStreamHandler.cs')
-rw-r--r-- | OpenSim/Framework/Servers/GetAssetStreamHandler.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/OpenSim/Framework/Servers/GetAssetStreamHandler.cs b/OpenSim/Framework/Servers/GetAssetStreamHandler.cs index c935d2a..1b87496 100644 --- a/OpenSim/Framework/Servers/GetAssetStreamHandler.cs +++ b/OpenSim/Framework/Servers/GetAssetStreamHandler.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.Framework.Servers | |||
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | // private OpenAsset_Main m_assetManager; | 50 | // private OpenAsset_Main m_assetManager; |
51 | private IAssetDataPlugin m_assetProvider; | 51 | private readonly IAssetDataPlugin m_assetProvider; |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Constructor. | 54 | /// Constructor. |
@@ -58,7 +58,7 @@ namespace OpenSim.Framework.Servers | |||
58 | public GetAssetStreamHandler(IAssetDataPlugin assetProvider) | 58 | public GetAssetStreamHandler(IAssetDataPlugin assetProvider) |
59 | : base("GET", "/assets") | 59 | : base("GET", "/assets") |
60 | { | 60 | { |
61 | m_log.Info("[REST]: In Get Request"); | 61 | // m_log.Info("[REST]: In Get Request"); |
62 | // m_assetManager = assetManager; | 62 | // m_assetManager = assetManager; |
63 | m_assetProvider = assetProvider; | 63 | m_assetProvider = assetProvider; |
64 | } | 64 | } |
@@ -66,10 +66,9 @@ namespace OpenSim.Framework.Servers | |||
66 | public override byte[] Handle(string path, Stream request, | 66 | public override byte[] Handle(string path, Stream request, |
67 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 67 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
68 | { | 68 | { |
69 | string param = GetParam(path); | ||
70 | byte[] result = new byte[] { }; | 69 | byte[] result = new byte[] { }; |
71 | 70 | ||
72 | string[] p = param.Split(new char[] { '/', '?', '&' }, StringSplitOptions.RemoveEmptyEntries); | 71 | string[] p = SplitParams(path); |
73 | 72 | ||
74 | if (p.Length > 0) | 73 | if (p.Length > 0) |
75 | { | 74 | { |
@@ -127,6 +126,13 @@ namespace OpenSim.Framework.Servers | |||
127 | return result; | 126 | return result; |
128 | } | 127 | } |
129 | 128 | ||
129 | public string[] SplitParams(string path) | ||
130 | { | ||
131 | string param = GetParam(path); | ||
132 | |||
133 | return param.Split(new char[] { '/', '?', '&' }, StringSplitOptions.RemoveEmptyEntries); | ||
134 | } | ||
135 | |||
130 | // private byte[] ProcessOutgoingAssetData(byte[] assetData) | 136 | // private byte[] ProcessOutgoingAssetData(byte[] assetData) |
131 | // { | 137 | // { |
132 | // string data = Encoding.ASCII.GetString(assetData); | 138 | // string data = Encoding.ASCII.GetString(assetData); |