aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorMelanie2012-09-06 17:11:44 +0200
committerMelanie2012-09-06 17:11:44 +0200
commitb9d026666dbabb210cc013d29eb79fe214594dd9 (patch)
treed1ca0185435ab482244791ed31f63531d2736cc8 /OpenSim/Services/Connectors
parentRevert " remove extra '/' in assets url" (diff)
downloadopensim-SC-b9d026666dbabb210cc013d29eb79fe214594dd9.zip
opensim-SC-b9d026666dbabb210cc013d29eb79fe214594dd9.tar.gz
opensim-SC-b9d026666dbabb210cc013d29eb79fe214594dd9.tar.bz2
opensim-SC-b9d026666dbabb210cc013d29eb79fe214594dd9.tar.xz
Change string concatenation to Path.Combine to eliminate extra slashes.
Windoze barfs on them.
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 45ebf3a..2a3dacc 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -181,7 +181,7 @@ namespace OpenSim.Services.Connectors
181 181
182 public AssetBase Get(string id) 182 public AssetBase Get(string id)
183 { 183 {
184 string uri = MapServer(id) + "/assets/" + id; 184 string uri = Path.Combine(MapServer(id), Path.Combine("assets", id));
185 185
186 AssetBase asset = null; 186 AssetBase asset = null;
187 if (m_Cache != null) 187 if (m_Cache != null)
@@ -218,7 +218,7 @@ namespace OpenSim.Services.Connectors
218 return fullAsset.Metadata; 218 return fullAsset.Metadata;
219 } 219 }
220 220
221 string uri = MapServer(id) + "/assets/" + id + "/metadata"; 221 string uri = Path.Combine(MapServer(id), Path.Combine("assets", id));
222 222
223 AssetMetadata asset = SynchronousRestObjectRequester. 223 AssetMetadata asset = SynchronousRestObjectRequester.
224 MakeRequest<int, AssetMetadata>("GET", uri, 0); 224 MakeRequest<int, AssetMetadata>("GET", uri, 0);
@@ -260,7 +260,7 @@ namespace OpenSim.Services.Connectors
260 260
261 public bool Get(string id, Object sender, AssetRetrieved handler) 261 public bool Get(string id, Object sender, AssetRetrieved handler)
262 { 262 {
263 string uri = MapServer(id) + "/assets/" + id; 263 string uri = Path.Combine(MapServer(id), Path.Combine("assets", id));
264 264
265 AssetBase asset = null; 265 AssetBase asset = null;
266 if (m_Cache != null) 266 if (m_Cache != null)
@@ -379,7 +379,9 @@ namespace OpenSim.Services.Connectors
379 return asset.ID; 379 return asset.ID;
380 } 380 }
381 381
382 string uri = MapServer(asset.FullID.ToString()) + "/assets/"; 382 string uri = Path.Combine(MapServer(asset.FullID.ToString()), "/assets/");
383 if (!uri.EndsWith("/"))
384 uri += "/";
383 385
384 string newID = string.Empty; 386 string newID = string.Empty;
385 try 387 try
@@ -456,7 +458,7 @@ namespace OpenSim.Services.Connectors
456 } 458 }
457 asset.Data = data; 459 asset.Data = data;
458 460
459 string uri = MapServer(id) + "/assets/" + id; 461 string uri = Path.Combine(MapServer(id), Path.Combine("assets", id));
460 462
461 if (SynchronousRestObjectRequester. 463 if (SynchronousRestObjectRequester.
462 MakeRequest<AssetBase, bool>("POST", uri, asset)) 464 MakeRequest<AssetBase, bool>("POST", uri, asset))
@@ -471,7 +473,7 @@ namespace OpenSim.Services.Connectors
471 473
472 public bool Delete(string id) 474 public bool Delete(string id)
473 { 475 {
474 string uri = MapServer(id) + "/assets/" + id; 476 string uri = Path.Combine(MapServer(id), Path.Combine("assets", id));
475 477
476 if (SynchronousRestObjectRequester. 478 if (SynchronousRestObjectRequester.
477 MakeRequest<int, bool>("DELETE", uri, 0)) 479 MakeRequest<int, bool>("DELETE", uri, 0))