private void CreateDir(string path, string name) { path = GetRelativePath(path); if (!_fileSystem.FolderExists(path)) { throw new Exception(LangRes("E_CreateDirInvalidPath")); } try { path = _fileSystem.Combine(path, name); if (!_fileSystem.FolderExists(path)) { _fileSystem.CreateFolder(path); } Response.Write(GetResultString()); } catch { throw new Exception(LangRes("E_CreateDirFailed")); } }
private bool PreparePut(CachedImage cachedImage, Stream stream) { Guard.NotNull(cachedImage, nameof(cachedImage)); if (stream == null) { return(false); } // create folder if needed string imageDir = System.IO.Path.GetDirectoryName(cachedImage.Path); if (imageDir.HasValue()) { _fileSystem.CreateFolder(BuildPath(imageDir)); } return(true); }
private void CreateDir(string path, string name) { path = GetRelativePath(path); try { path = _fileSystem.Combine(path, name); _fileSystem.CreateFolder(path); Response.Write(GetResultString()); } catch (Exception ex) { throw ex; } }