public MultiPartDownloader(Downloadable File = null)
 {
     if (File != null)
     {
         this.File = File;
     }
 }
Example #2
0
        public Downloader(Downloadable File = null)
        {
            //optimize the network connction
            NetworkHelper.ConnectionOptimizer();

            if (File != null)
            {
                this.File = File;
            }
        }
Example #3
0
        public HeaderParser(Downloadable File = null)
        {
            if (File != null)
            {
                this.File = File;
            }

            //optimize netwok connection
            NetworkHelper.ConnectionOptimizer();
        }
Example #4
0
        public void ParseHeader(Downloadable File = null)
        {
            if (File != null)
            {
                this.File = File;
            }

            if (this.File == null)
            {
                throw new Exception("File was Null Supply a Downloadable to Header Parser");
            }

            //Set File size negative
            this.File.Size = -1;

            Task.Run(() =>
            {
                try
                {
                    //Get File Size from server
                    SetFileSize();
                }
                catch (Exception)
                {
                    //To Do
                }


                try
                {
                    //Get File Name And File Type web server
                    GetFilePropertiesFromServer();
                }
                catch (Exception e)
                {
                    OnError?.Invoke(this, e);
                    return;
                }


                //Get explicit file Name
                ExplicitFileName();

                //Remove Illegal Character from file Name
                RemoveIllegalCharFromName();

                //Inform User About Task Completition
                OnParseSuccess?.Invoke(this, this.File);
            });
        }
 public SinglePartUnknownDownloader(Downloadable File)
 {
     this.File = File;
 }