Esempio n. 1
0
        //подпапки
        public ICollection <IEntry> GetItems()
        {
            List <IEntry> subItems = new List <IEntry>();

            IEntry fullname = FileFactory.CreateEntry(FullName);

            if (fullname is MyZip)
            {
                string outsideZip, insideZip;
                MyFileStream.ParseZipPath(FullName, out outsideZip, out insideZip);

                MyZip zip = new MyZip(outsideZip);
                foreach (IEntry entry in zip.GetAllItems())
                {
                    if (entry.FullName.Contains(Name + "/"))
                    {
                        subItems.Add(FileFactory.CreateEntry(entry.FullName.Replace('/', '\\')));
                    }
                }
            }
            else
            {
                foreach (IDirectory dir in dotNETDir.GetDirectories())
                {
                    subItems.Add(FileFactory.CreateEntry(dir.FullName));
                }
                foreach (IFile f in dotNETDir.GetFiles())
                {
                    subItems.Add(FileFactory.CreateEntry(f.FullName));
                }
            }
            return(subItems);
        }
Esempio n. 2
0
 public void Create(byte[] content)
 {
     try
     {
         MyFileStream.CreateFile(FullName, content);
     }
     catch (Exception e)
     {
         throw new MyException("Ошибка при создании файла", e);
     }
 }
Esempio n. 3
0
 public byte[] Open()
 {
     return(MyFileStream.Open(FullName));
 }
Esempio n. 4
0
 public void Create(byte[] content)
 {
     MyFileStream.CreateFile(FullName, content);
 }
Esempio n. 5
0
 public static void Delete(string fullName)
 {
     MyFileStream.Delete(fullName);
 }
Esempio n. 6
0
 public void Create(byte[] content = null)
 {
     MyFileStream.CreateDirectory(FullName);
 }