aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs23
1 files changed, 13 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 9a0f19a..09776a7 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
52 private static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); 52 private static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
53 53
54 private Scene m_scene; 54 private Scene m_scene;
55 private string m_loadPath; 55 private Stream m_loadStream;
56 56
57 /// <summary> 57 /// <summary>
58 /// Used to cache lookups for valid uuids. 58 /// Used to cache lookups for valid uuids.
@@ -62,12 +62,19 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
62 public ArchiveReadRequest(Scene scene, string loadPath) 62 public ArchiveReadRequest(Scene scene, string loadPath)
63 { 63 {
64 m_scene = scene; 64 m_scene = scene;
65 m_loadPath = loadPath; 65 m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress);
66
67 DearchiveRegion();
68 } 66 }
67
68 public ArchiveReadRequest(Scene scene, Stream loadStream)
69 {
70 m_scene = scene;
71 m_loadStream = loadStream;
72 }
69 73
70 private void DearchiveRegion() 74 /// <summary>
75 /// Dearchive the region embodied in this request.
76 /// </summary>
77 public void DearchiveRegion()
71 { 78 {
72 // The same code can handle dearchiving 0.1 and 0.2 OpenSim Archive versions 79 // The same code can handle dearchiving 0.1 and 0.2 OpenSim Archive versions
73 DearchiveRegion0DotStar(); 80 DearchiveRegion0DotStar();
@@ -75,9 +82,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
75 82
76 private void DearchiveRegion0DotStar() 83 private void DearchiveRegion0DotStar()
77 { 84 {
78 TarArchiveReader archive 85 TarArchiveReader archive = new TarArchiveReader(m_loadStream);
79 = new TarArchiveReader(
80 new GZipStream(GetStream(m_loadPath), CompressionMode.Decompress));
81 86
82 //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); 87 //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache);
83 88
@@ -368,7 +373,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
368 /// <summary> 373 /// <summary>
369 /// Resolve path to a working FileStream 374 /// Resolve path to a working FileStream
370 /// </summary> 375 /// </summary>
371
372 private Stream GetStream(string path) 376 private Stream GetStream(string path)
373 { 377 {
374 try 378 try
@@ -392,7 +396,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
392 // OK, now we know we have an HTTP URI to work with 396 // OK, now we know we have an HTTP URI to work with
393 397
394 return URIFetch(uri); 398 return URIFetch(uri);
395
396 } 399 }
397 } 400 }
398 } 401 }