diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 2704224..708bed3 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs | |||
@@ -41,17 +41,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
41 | public class AssetsArchiver | 41 | public class AssetsArchiver |
42 | { | 42 | { |
43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Archive assets | 46 | /// Archive assets |
47 | /// </summary> | 47 | /// </summary> |
48 | protected IDictionary<LLUUID, AssetBase> m_assets; | 48 | protected IDictionary<LLUUID, AssetBase> m_assets; |
49 | 49 | ||
50 | public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets) | 50 | public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets) |
51 | { | 51 | { |
52 | m_assets = assets; | 52 | m_assets = assets; |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Archive the assets given to this archiver to the given archive. | 56 | /// Archive the assets given to this archiver to the given archive. |
57 | /// </summary> | 57 | /// </summary> |
@@ -70,44 +70,44 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
70 | { | 70 | { |
71 | StringWriter sw = new StringWriter(); | 71 | StringWriter sw = new StringWriter(); |
72 | XmlTextWriter xtw = new XmlTextWriter(sw); | 72 | XmlTextWriter xtw = new XmlTextWriter(sw); |
73 | 73 | ||
74 | xtw.Formatting = Formatting.Indented; | 74 | xtw.Formatting = Formatting.Indented; |
75 | xtw.WriteStartDocument(); | 75 | xtw.WriteStartDocument(); |
76 | 76 | ||
77 | xtw.WriteStartElement("assets"); | 77 | xtw.WriteStartElement("assets"); |
78 | 78 | ||
79 | foreach (LLUUID uuid in m_assets.Keys) | 79 | foreach (LLUUID uuid in m_assets.Keys) |
80 | { | 80 | { |
81 | AssetBase asset = m_assets[uuid]; | 81 | AssetBase asset = m_assets[uuid]; |
82 | 82 | ||
83 | if (asset != null) | 83 | if (asset != null) |
84 | { | 84 | { |
85 | xtw.WriteStartElement("asset"); | 85 | xtw.WriteStartElement("asset"); |
86 | 86 | ||
87 | string extension = string.Empty; | 87 | string extension = string.Empty; |
88 | 88 | ||
89 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) | 89 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
90 | { | 90 | { |
91 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; | 91 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
92 | } | 92 | } |
93 | 93 | ||
94 | xtw.WriteElementString("filename", uuid.ToString() + extension); | 94 | xtw.WriteElementString("filename", uuid.ToString() + extension); |
95 | 95 | ||
96 | xtw.WriteElementString("name", asset.Name); | 96 | xtw.WriteElementString("name", asset.Name); |
97 | xtw.WriteElementString("description", asset.Description); | 97 | xtw.WriteElementString("description", asset.Description); |
98 | xtw.WriteElementString("asset-type", asset.Type.ToString()); | 98 | xtw.WriteElementString("asset-type", asset.Type.ToString()); |
99 | 99 | ||
100 | xtw.WriteEndElement(); | 100 | xtw.WriteEndElement(); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | xtw.WriteEndElement(); | 104 | xtw.WriteEndElement(); |
105 | 105 | ||
106 | xtw.WriteEndDocument(); | 106 | xtw.WriteEndDocument(); |
107 | 107 | ||
108 | archive.AddFile("assets.xml", sw.ToString()); | 108 | archive.AddFile("assets.xml", sw.ToString()); |
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// Write asset data files to the given archive | 112 | /// Write asset data files to the given archive |
113 | /// </summary> | 113 | /// </summary> |
@@ -116,18 +116,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
116 | { | 116 | { |
117 | // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar | 117 | // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar |
118 | //archive.AddDir("assets"); | 118 | //archive.AddDir("assets"); |
119 | 119 | ||
120 | foreach (LLUUID uuid in m_assets.Keys) | 120 | foreach (LLUUID uuid in m_assets.Keys) |
121 | { | 121 | { |
122 | AssetBase asset = m_assets[uuid]; | 122 | AssetBase asset = m_assets[uuid]; |
123 | 123 | ||
124 | string extension = string.Empty; | 124 | string extension = string.Empty; |
125 | 125 | ||
126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) | 126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
127 | { | 127 | { |
128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; | 128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
129 | } | 129 | } |
130 | 130 | ||
131 | archive.AddFile( | 131 | archive.AddFile( |
132 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, | 132 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, |
133 | asset.Data); | 133 | asset.Data); |