aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-11-09 16:08:17 +0000
committerJustin Clark-Casey (justincc)2009-11-09 16:08:17 +0000
commit6820cc93ec82bc97e59fda2696f07b046e7006e0 (patch)
tree77b2bcd2c469fdd7b75e30999e9baea578bb63ca
parentminor: remove some mono compiler warnings (diff)
downloadopensim-SC-6820cc93ec82bc97e59fda2696f07b046e7006e0.zip
opensim-SC-6820cc93ec82bc97e59fda2696f07b046e7006e0.tar.gz
opensim-SC-6820cc93ec82bc97e59fda2696f07b046e7006e0.tar.bz2
opensim-SC-6820cc93ec82bc97e59fda2696f07b046e7006e0.tar.xz
refactor path delimiter in iar utils
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs12
1 files changed, 7 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
index 7e72ca0..0fb5db2 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
@@ -45,7 +45,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
45 45
46 // Character used for escaping the path delimter ("\/") and itself ("\\") in human escaped strings 46 // Character used for escaping the path delimter ("\/") and itself ("\\") in human escaped strings
47 public static readonly char ESCAPE_CHARACTER = '\\'; 47 public static readonly char ESCAPE_CHARACTER = '\\';
48 public static readonly string PATH_DELIMITER = "/"; 48
49 // The character used to separate inventory path components (different folders and items)
50 public static readonly char PATH_DELIMITER = '/';
49 51
50 /// <summary> 52 /// <summary>
51 /// Find a folder given a PATH_DELIMITER delimited path starting from a user's root folder 53 /// Find a folder given a PATH_DELIMITER delimited path starting from a user's root folder
@@ -110,10 +112,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
110 112
111 path = path.Trim(); 113 path = path.Trim();
112 114
113 if (path == PATH_DELIMITER) 115 if (path == PATH_DELIMITER.ToString())
114 return startFolder; 116 return startFolder;
115 117
116 string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); 118 string[] components = path.Split(new string[] { PATH_DELIMITER.ToString() }, 2, StringSplitOptions.None);
117 InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); 119 InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID);
118 120
119 foreach (InventoryFolderBase folder in contents.Folders) 121 foreach (InventoryFolderBase folder in contents.Folders)
@@ -244,7 +246,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
244 } 246 }
245 else 247 else
246 { 248 {
247 if (PATH_DELIMITER == path[i].ToString() && !singleEscapeChar) 249 if (PATH_DELIMITER == path[i] && !singleEscapeChar)
248 return new string[2] { path.Remove(i), path.Substring(i + 1) }; 250 return new string[2] { path.Remove(i), path.Substring(i + 1) };
249 else 251 else
250 singleEscapeChar = false; 252 singleEscapeChar = false;
@@ -276,7 +278,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
276 278
277 if (singleEscapeChar) 279 if (singleEscapeChar)
278 { 280 {
279 if (PATH_DELIMITER == path[i].ToString()) 281 if (PATH_DELIMITER == path[i])
280 sb.Append(PATH_DELIMITER); 282 sb.Append(PATH_DELIMITER);
281 } 283 }
282 else 284 else