aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-08-26 18:14:10 +0000
committerJustin Clarke Casey2008-08-26 18:14:10 +0000
commitf0448e299d4ef970ad9789f1df2811f54f0513f8 (patch)
treeb8d6dd2d6814902251e737dd88932a09b2ebc5e7 /OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
parent* One more tweak to the application/xml vs application/llsd+xml routine (diff)
downloadopensim-SC-f0448e299d4ef970ad9789f1df2811f54f0513f8.zip
opensim-SC-f0448e299d4ef970ad9789f1df2811f54f0513f8.tar.gz
opensim-SC-f0448e299d4ef970ad9789f1df2811f54f0513f8.tar.bz2
opensim-SC-f0448e299d4ef970ad9789f1df2811f54f0513f8.tar.xz
* On loading archives, report an error if an asset does not have the expected filename format
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 87106fb..201986e 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -211,7 +211,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
211 { 211 {
212 // Right now we're nastily obtaining the lluuid from the filename 212 // Right now we're nastily obtaining the lluuid from the filename
213 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); 213 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length);
214 string extension = filename.Substring(filename.LastIndexOf("_")); 214 int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR);
215
216 if (i == -1)
217 {
218 m_log.ErrorFormat(
219 "[ARCHIVER]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping",
220 assetPath, ArchiveConstants.ASSET_EXTENSION_SEPARATOR);
221
222 return false;
223 }
224
225 string extension = filename.Substring(i);
215 string uuid = filename.Remove(filename.Length - extension.Length); 226 string uuid = filename.Remove(filename.Length - extension.Length);
216 227
217 if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) 228 if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension))