示例#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));
        }
示例#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);
        }
示例#3
0
 public void delete(PhysicFile pf)
 {
     list.Remove(pf);
 }
示例#4
0
 public void add(PhysicFile pf)
 {
     list.Add(pf);
 }
示例#5
0
 public bool Equals(PhysicFile pf)
 {
     return this.abstractFile.Equals(pf.abstractFile);
 }
示例#6
0
 public void delete(PhysicFile pf)
 {
     lock(this)
         list.Remove(pf);
 }
示例#7
0
 public void add(PhysicFile pf)
 {
     lock(this)
         list.Add(pf);
 }
示例#8
0
 public bool Equals(PhysicFile pf)
 {
     return(this.abstractFile.Equals(pf.abstractFile));
 }
示例#9
0
 public void delete(PhysicFile pf)
 {
     lock (this)
         list.Remove(pf);
 }
示例#10
0
 public void add(PhysicFile pf)
 {
     lock (this)
         list.Add(pf);
 }
示例#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);
        }