Exemplo n.º 1
0
 public MyFile(string filePath, int fileSize, bool readOnly, bool archiveFile) : this(filePath)
 {
     FileSize      = fileSize;
     IsReadOnly    = readOnly;
     IsArchiveFile = archiveFile;
     IsInfected    = VirusScanner.IsFileInfected(this);
 }
Exemplo n.º 2
0
        public MyFile(string FilePath, int fileSize, bool isReadOnly, bool isArchive) : this(FilePath)
        {
            FileSize   = fileSize;
            IsReadOnly = isReadOnly;
            IsArchive  = isArchive;

            IsInfected = VirusScanner.IsFileInfected(this);
        }
Exemplo n.º 3
0
        static List <string> paths = new List <string>(); //2.e


        public MyFile(string filePath, int FileSize, bool IsReadOnly, bool IsZipped)
        {
            this.filePath   = filePath;
            this.FileSize   = FileSize;   //2.d.5
            this.IsReadOnly = IsReadOnly; //2.d.5
            this.IsZipped   = IsZipped;   //2.d.5
            paths.Add(filePath);          //2.e


            IsVirus = VirusScanner.IsfileInfected(FileSize);     // check is file is virus infected //6
            if (IsVirus == true)
            {
                throw new InfectedFileDetectedException(filePath);     // if file is infected throw exception//7
            }
        }
Exemplo n.º 4
0
 public MyFile(string filePath, int size, bool isReadOnly, bool isArchive)
 {
     this.filePath   = filePath;
     this.size       = size;
     this.isReadOnly = isReadOnly;
     this.isArchive  = isArchive;
     this.isInfected = VirusScanner.IsFileInfected(this);
     if (this.IsInfected)
     {
         throw new InfectedFileDetectedException(this.FilePath);
     }
     if (paths == null)
     {
         paths = new List <string>();
     }
     paths.Add(filePath);
 }