public virtual void AddFile(Site site, string dirRelativePath, string fileName, Stream fileStream) { var file = new FileEntry(GetRootDir(site), GetRelativePath(dirRelativePath, fileName)); if (fileStream != null) { file.Save(fileStream); } else { file.Save(); } }
public virtual void AddFile(Site site, string dirRelativePath, string fileName, string body) { var file = new FileEntry(GetRootDir(site), GetRelativePath(dirRelativePath, fileName)); file.Body = body; file.Save(); }
public virtual FileEntry EditFile(Site site, string dirRelativePath, string oldRelativePath, string oldFileName, string body) { var @new = new FileEntry(GetRootDir(site), GetRelativePath(dirRelativePath, oldFileName)); var old = new FileEntry(GetRootDir(site), oldRelativePath); File.Move(old.PhysicalPath, @new.PhysicalPath); @new.Body = body; @new.Save(); return(@new); }
public virtual FileEntry EditFile(Site site, string relativePath, string body) { FileEntry entry = new FileEntry(GetRootDir(site), relativePath); entry.Body = body; entry.Save(); FlushWebResourceCache(site, entry); return(entry); }
public virtual FileEntry EditFile(Site site, string dirRelativePath, string oldRelativePath, string oldFileName, string body) { var @new = new FileEntry(GetRootDir(site), GetRelativePath(dirRelativePath, oldFileName)); var old = new FileEntry(GetRootDir(site), oldRelativePath); File.Move(old.PhysicalPath, @new.PhysicalPath); @new.Body = body; @new.Save(); return @new; }
public virtual FileEntry EditFile(Site site, string relativePath, string body) { FileEntry entry = new FileEntry(GetRootDir(site), relativePath); entry.Body = body; entry.Save(); FlushWebResourceCache(site, entry); return entry; }