Changeset 1759


Ignore:
Timestamp:
2/8/2010 4:47:44 AM (4 years ago)
Author:
lowjoel
Message:

Give all downloaded files an index to ensure uniqueness of every file. Addresses #307: Eraser Updater restructuring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/CodeReview/Eraser/UpdateForm.cs

    r1757 r1759  
    720720                    //Create the file name. 
    721721                    DownloadedFile = new FileInfo(Path.Combine( 
    722                         TempPath.FullName, contentDisposition == null ? 
    723                             Path.GetFileName(Link.GetComponents(UriComponents.Path, UriFormat.Unescaped)) : 
    724                             contentDisposition.FileName)); 
     722                        TempPath.FullName, string.Format(CultureInfo.InvariantCulture, 
     723                            "{0:00}-{1}", ++DownloadFileIndex, contentDisposition == null ? 
     724                                Path.GetFileName(Link.GetComponents(UriComponents.Path, UriFormat.Unescaped)) : 
     725                                contentDisposition.FileName))); 
    725726 
    726727                    using (Stream responseStream = response.GetResponseStream()) 
     
    785786 
    786787        /// <summary> 
     788        /// Counter to ensure that files downloaded with a similar name are not overwritten 
     789        /// over each other 
     790        /// </summary> 
     791        private static int DownloadFileIndex; 
     792 
     793        /// <summary> 
    787794        /// Stores information about the temporary file which the download was stored into. 
    788795        /// </summary> 
Note: See TracChangeset for help on using the changeset viewer.