aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-19 17:51:42 +0000
committerJustin Clarke Casey2008-10-19 17:51:42 +0000
commitf7205da1d9e9aacf07c6e8e65f68f03848f2cb04 (patch)
treef60a02578aca207bcd6d95e034fdc790dcef9ac9 /OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
parent* Fixed UDP server (again) (diff)
downloadopensim-SC_OLD-f7205da1d9e9aacf07c6e8e65f68f03848f2cb04.zip
opensim-SC_OLD-f7205da1d9e9aacf07c6e8e65f68f03848f2cb04.tar.gz
opensim-SC_OLD-f7205da1d9e9aacf07c6e8e65f68f03848f2cb04.tar.bz2
opensim-SC_OLD-f7205da1d9e9aacf07c6e8e65f68f03848f2cb04.tar.xz
* move command line parsing code from inventory archive modules to opensim server
* use default inventory archive name if none is given * other minor cleanups * this facility is not useable yet
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs26
1 files changed, 12 insertions, 14 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 195dade..017ebcc 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -41,15 +41,20 @@ using log4net;
41 41
42 42
43namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver 43namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
44{ 44{
45 public class InventoryArchiveWriteRequest 45 public class InventoryArchiveWriteRequest
46 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48
47 protected Scene scene; 49 protected Scene scene;
48 protected TarArchiveWriter archive; 50 protected TarArchiveWriter archive;
49 protected CommunicationsManager commsManager; 51 protected CommunicationsManager commsManager;
50 Dictionary<UUID, int> assetUuids; 52 Dictionary<UUID, int> assetUuids;
51 string savePath; 53
52 54 /// <value>
55 /// The path to which the inventory archive will be saved.
56 /// </value>
57 private string m_savePath;
53 58
54 public InventoryArchiveWriteRequest(Scene currentScene, CommunicationsManager commsManager) 59 public InventoryArchiveWriteRequest(Scene currentScene, CommunicationsManager commsManager)
55 { 60 {
@@ -63,7 +68,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
63 { 68 {
64 AssetsArchiver assetsArchiver = new AssetsArchiver(assetsFound); 69 AssetsArchiver assetsArchiver = new AssetsArchiver(assetsFound);
65 assetsArchiver.Archive(archive); 70 assetsArchiver.Archive(archive);
66 archive.WriteTar(new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress)); 71 archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress));
67 } 72 }
68 73
69 protected void saveInvItem(InventoryItemBase inventoryItem, string path) 74 protected void saveInvItem(InventoryItemBase inventoryItem, string path)
@@ -156,15 +161,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
156 } 161 }
157 } 162 }
158 163
159 public void execute(string[] cmdparams) 164 public void execute(string firstName, string lastName, string invPath, string savePath)
160 { 165 {
161 ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 166 m_savePath = savePath;
162 167
163 string firstName = cmdparams[0];
164 string lastName = cmdparams[1];
165 string invPath = cmdparams[2];
166 savePath = (cmdparams.Length > 3 ? cmdparams[3] : "inventory.tar.gz");
167
168 UserProfileData userProfile = commsManager.UserService.GetUserProfile(firstName, lastName); 168 UserProfileData userProfile = commsManager.UserService.GetUserProfile(firstName, lastName);
169 if (null == userProfile) 169 if (null == userProfile)
170 { 170 {
@@ -242,8 +242,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
242 } 242 }
243 243
244 new AssetsRequest(assetUuids.Keys, scene.AssetCache, ReceivedAllAssets).Execute(); 244 new AssetsRequest(assetUuids.Keys, scene.AssetCache, ReceivedAllAssets).Execute();
245
246 } 245 }
247
248 } 246 }
249} 247}