aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/FileAssetClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/FileAssetClient.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/FileAssetClient.cs16
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/Cache/FileAssetClient.cs b/OpenSim/Framework/Communications/Cache/FileAssetClient.cs
index 3c74d4d..e793feb 100644
--- a/OpenSim/Framework/Communications/Cache/FileAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/FileAssetClient.cs
@@ -18,11 +18,13 @@ namespace OpenSim.Framework.Communications.Cache
18 } 18 }
19 public override void StoreAsset(AssetBase asset) 19 public override void StoreAsset(AssetBase asset)
20 { 20 {
21 string cdir = m_dir + Path.DirectorySeparatorChar + asset.FullID.Data[0] 21 byte[] idBytes = asset.FullID.Guid.ToByteArray();
22 + Path.DirectorySeparatorChar + asset.FullID.Data[1];
23 22
24 if (!Directory.Exists(m_dir + Path.DirectorySeparatorChar + asset.FullID.Data[0])) 23 string cdir = m_dir + Path.DirectorySeparatorChar + idBytes[0]
25 Directory.CreateDirectory(m_dir + Path.DirectorySeparatorChar + asset.FullID.Data[0]); 24 + Path.DirectorySeparatorChar + idBytes[1];
25
26 if (!Directory.Exists(m_dir + Path.DirectorySeparatorChar + idBytes[0]))
27 Directory.CreateDirectory(m_dir + Path.DirectorySeparatorChar + idBytes[0]);
26 28
27 if (!Directory.Exists(cdir)) 29 if (!Directory.Exists(cdir))
28 Directory.CreateDirectory(cdir); 30 Directory.CreateDirectory(cdir);
@@ -41,8 +43,10 @@ namespace OpenSim.Framework.Communications.Cache
41 43
42 protected override AssetBase GetAsset(AssetRequest req) 44 protected override AssetBase GetAsset(AssetRequest req)
43 { 45 {
44 string cdir = m_dir + Path.DirectorySeparatorChar + req.AssetID.Data[0] 46 byte[] idBytes = req.AssetID.Guid.ToByteArray();
45 + Path.DirectorySeparatorChar + req.AssetID.Data[1]; 47
48 string cdir = m_dir + Path.DirectorySeparatorChar + idBytes[0]
49 + Path.DirectorySeparatorChar + idBytes[1];
46 if (File.Exists(cdir + Path.DirectorySeparatorChar + req.AssetID + ".xml")) 50 if (File.Exists(cdir + Path.DirectorySeparatorChar + req.AssetID + ".xml"))
47 { 51 {
48 FileStream x = File.OpenRead(cdir + Path.DirectorySeparatorChar + req.AssetID + ".xml"); 52 FileStream x = File.OpenRead(cdir + Path.DirectorySeparatorChar + req.AssetID + ".xml");