public string GetMappedDirectory(string VirtualDirectory) { string MappedDir = Convert.ToString(DataCache.GetCache("DirMap:" + VirtualDirectory)); if (MappedDir == "") { MappedDir = FileSystemUtils.AddTrailingSlash(HttpContext.Current.Server.MapPath(VirtualDirectory)); DataCache.SetCache("DirMap:" + VirtualDirectory, MappedDir); } return(MappedDir); }
public void SetMappedDirectory(string VirtualDirectory, HttpContext context) { try { string MappedDir = FileSystemUtils.AddTrailingSlash(context.Server.MapPath(VirtualDirectory)); DataCache.SetCache("DirMap:" + VirtualDirectory, MappedDir); } catch (Exception exc) { Exceptions.Exceptions.LogException(exc); } }
public void SetMappedDirectory(string virtualDirectory) { try { string mappedDir = FileSystemUtils.AddTrailingSlash(FileSystemUtils.MapPath(virtualDirectory)); DataCache.SetCache("DirMap:" + virtualDirectory, mappedDir); } catch (Exception exc) { Exceptions.Exceptions.LogException(exc); } }
public void SetMappedDirectory(string virtualDirectory, HttpContext context) { try { // The logic here was updated to use the new FileSystemUtils.MapPath so that we have consistent behavior with other Overloads string mappedDir = FileSystemUtils.AddTrailingSlash(FileSystemUtils.MapPath(virtualDirectory)); DataCache.SetCache("DirMap:" + virtualDirectory, mappedDir); } catch (Exception exc) { Exceptions.Exceptions.LogException(exc); } }
public string GetMappedDirectory(string virtualDirectory) { string mappedDir = Convert.ToString(DataCache.GetCache("DirMap:" + virtualDirectory)); try { if (string.IsNullOrEmpty(mappedDir) && HttpContext.Current != null) { mappedDir = FileSystemUtils.AddTrailingSlash(FileSystemUtils.MapPath(virtualDirectory)); DataCache.SetCache("DirMap:" + virtualDirectory, mappedDir); } } catch (Exception exc) { Exceptions.Exceptions.LogException(exc); } return(mappedDir); }
private void MassRename(string DestPath, string prefix) { string strSourcePath = FileSystemUtils.AddTrailingSlash(PortalSettings.HomeDirectoryMapPath + DestPath); string[] fileNames = Directory.GetFiles(strSourcePath); List <string> changedFiles = new List <string>(); foreach (string fileName in fileNames) { if (fileName.StartsWith(strSourcePath + prefix)) { FileSystemUtils.MoveFile(fileName, fileName.Replace(strSourcePath + prefix, strSourcePath), PortalSettings); changedFiles.Add(fileName.Replace(strSourcePath + prefix, string.Empty)); } } foreach (string fileName in changedFiles) { lblResults.Text += fileName + "<br />"; } }