Exemplo n.º 1
0
        private void InstallEntry(ParallelReadableZipArchiveEntry entry, string targetPath)
        {
            var directoryName = Path.GetDirectoryName(targetPath);

            Directory.CreateDirectory(directoryName);
            entry.ExtractToFile(targetPath, true);
        }
Exemplo n.º 2
0
 public FileWithVersionInNameUpgradeAction(ParallelReadableZipArchiveEntry installedEntry, Version installedVersion, ParallelReadableZipArchiveEntry newEntry, Version newVersion, string targetPath)
 {
     this.installedEntry        = installedEntry;
     this.installedVersion      = installedVersion;
     this.newEntry              = newEntry;
     this.newVersion            = newVersion;
     this.rootPathOfApplication = targetPath;
 }
Exemplo n.º 3
0
        public Version GetVersion(ParallelReadableZipArchiveEntry entry)
        {
            int    startIndex = entry.FullName.IndexOf(fileDeploymentKey + "/") + fileDeploymentKey.Length + 1;
            int    endIndex   = entry.FullName.IndexOf("/", startIndex);
            string version    = entry.FullName.Substring(startIndex, endIndex - startIndex);

            return(new Version(version));
        }
Exemplo n.º 4
0
        private void UpgradeEntry(ParallelReadableZipArchiveEntry entry, string targetPath)
        {
            if (File.Exists(targetPath))
            {
                var existingFileLastWriteTime = File.GetLastWriteTimeUtc(targetPath);
                var entryLastWriteTime        = entry.LastWriteTime.UtcDateTime;
                if (existingFileLastWriteTime.Equals(entryLastWriteTime))
                {
                    return;
                }
            }

            InstallEntry(entry, targetPath);
        }
Exemplo n.º 5
0
 public FileWithVersionInNameRemoveAction(ParallelReadableZipArchiveEntry zipArchiveEntry, Version version, string targetPath)
 {
     this.targetPath = targetPath;
     this.version    = version;
 }
        public void AddRemovedEntry(ParallelReadableZipArchiveEntry removedEntry, string removedEntryRelativeFullName)
        {
            var targetPath = GetTargetPath(removedEntryRelativeFullName);

            deploymentComponents.Add(new FileRemoveAction(removedEntry, targetPath));
        }
        public void AddNewEntry(ParallelReadableZipArchiveEntry newEntry, string newEntryRelativeFullName)
        {
            var targetPath = GetTargetPath(newEntryRelativeFullName);

            deploymentComponents.Add(new FileUpgradeAction(newEntry, targetPath));
        }
Exemplo n.º 8
0
 private void RemoveEntry(ParallelReadableZipArchiveEntry entry, string targetPath)
 {
     File.Delete(targetPath);
 }
Exemplo n.º 9
0
 public FileRemoveAction(ParallelReadableZipArchiveEntry zipArchiveEntry, string targetPath)
 {
     entry           = zipArchiveEntry;
     this.targetPath = targetPath;
 }
Exemplo n.º 10
0
        public string GetRelativePathWithOutKeyAndVersion(ParallelReadableZipArchiveEntry entry, string key, Version version)
        {
            string relativePath = entry.FullName.Remove(0, key.Length + 1 + version.ToString().Length + 1);

            return(relativePath);
        }
Exemplo n.º 11
0
 private bool ResponsibleFor(ParallelReadableZipArchiveEntry entry)
 {
     return(entry.FullName.StartsWith(fileDeploymentKey, StringComparison.OrdinalIgnoreCase));
 }
        private void AddRemovedEntry(ParallelReadableZipArchiveEntry removedEntry, Version removedVersion, string removedEntryRelativeFullName)
        {
            var targetPath = GetTargetPath(removedEntryRelativeFullName);

            deploymentComponents.Add(new FileWithVersionInNameRemoveAction(removedEntry, removedVersion, targetPath));
        }
        private void AddNewEntry(ParallelReadableZipArchiveEntry newEntry, Version newVersion, string newEntryRelativeFullName)
        {
            var targetPath = GetTargetPath(newEntryRelativeFullName);

            deploymentComponents.Add(new FileWithVersionInNameInstallAction(newEntry, newVersion, targetPath));
        }
Exemplo n.º 14
0
 public FileUpgradeAction(ParallelReadableZipArchiveEntry zipArchiveEntry, string targetPath)
 {
     entry = zipArchiveEntry;
     this.rootPathOfApplication = targetPath;
 }
Exemplo n.º 15
0
        public string GetRelativePathWithOutKey(ParallelReadableZipArchiveEntry entry, string key)
        {
            string relativePath = entry.FullName.Remove(0, key.Length + 1);

            return(relativePath);
        }