Exemple #1
0
        public UploadData getFile(SerializedVersion serV)
        {
            FBVersion  ver   = FBVersion.deserialize(serV.encodedVersion);
            PhysicFile found = null;

            if (ver.fileList.Count != 1)
            {
                return(null);
            }

            foreach (FBFile file in ver.fileList)
            {
                found = findPhysicFile(file);
                if (found == null)
                {
                    return(null);
                }
            }

            FileStream fStream = new FileStream(found.getRealFileInfo().FullName,
                                                FileMode.Open, FileAccess.Read);
            String token   = Server.GetUniqueKey(20);
            var    secDown = new SecureDownloader(this, token, null, null, fStream);

            return(new UploadData(UsefullMethods.GetLocalIPAddress(), secDown.port,
                                  token));
        }
Exemple #2
0
        public void ManageCompleteUpload(FBFile f, PhysicFile pf, string token)
        {
            this.uploadedFiles.add(pf);

            this.necessaryFiles.Remove(f);
            SecureChannel chan;

            this.channels.TryRemove(token, out chan);
        }
Exemple #3
0
 public void delete(PhysicFile pf)
 {
     list.Remove(pf);
 }
Exemple #4
0
 public void add(PhysicFile pf)
 {
     list.Add(pf);
 }
Exemple #5
0
 public bool Equals(PhysicFile pf)
 {
     return this.abstractFile.Equals(pf.abstractFile);
 }
Exemple #6
0
 public void delete(PhysicFile pf)
 {
     lock(this)
         list.Remove(pf);
 }
Exemple #7
0
 public void add(PhysicFile pf)
 {
     lock(this)
         list.Add(pf);
 }
Exemple #8
0
 public bool Equals(PhysicFile pf)
 {
     return(this.abstractFile.Equals(pf.abstractFile));
 }
Exemple #9
0
 public void delete(PhysicFile pf)
 {
     lock (this)
         list.Remove(pf);
 }
Exemple #10
0
 public void add(PhysicFile pf)
 {
     lock (this)
         list.Add(pf);
 }
Exemple #11
0
        public void ManageCompleteUpload(FBFile f, PhysicFile pf, string token)
        {
            this.uploadedFiles.add(pf);

            this.necessaryFiles.Remove(f);
            SecureChannel chan;
            this.channels.TryRemove(token, out chan);
        }