private static string ScrubFilePath(string filePath)
{
string newFilePath = String.Format("{0}", filePath).Trim().Replace(@"//", @"/").Replace(@"\", @"/");
string[] newPaths = newFilePath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
newPaths = newPaths.ToList().Select(x => ScrubSpecial(x)).ToArray();
newFilePath = String.Join("/", newPaths.ToArray());
if (!newFilePath.StartsWith(@"/")) {
newFilePath = String.Format("/{0}", newFilePath).Trim();
}
return newFilePath;
}