示例#1
0
        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();
            }
        }
示例#2
0
        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();
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 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;
 }
示例#6
0
 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();
 }
示例#7
0
 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();
     }
 }
示例#8
0
        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;
        }