Exemplo n.º 1
0
        public GitPackFile(IFileSystem fileSystem, string filename, ICompressionStrategy compression, GitPackIndex index, IDeltaDecoder delta)
        {
            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }
            if (String.IsNullOrEmpty(filename))
            {
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Cannot_Be_Null_Or_Empty, "filename"), "filename");
            }
            if (compression == null)
            {
                throw new ArgumentNullException("compression");
            }
            if (index == null)
            {
                throw new ArgumentNullException("index");
            }
            if (delta == null)
            {
                throw new ArgumentNullException("delta");
            }

            FileSystem   = fileSystem;
            PackFileName = filename;
            Compression  = compression;
            Index        = index;
            Delta        = delta;
        }
Exemplo n.º 2
0
        public GitPackFile(IFileSystem fileSystem, string filename, ICompressionStrategy compression, GitPackIndex index, IDeltaDecoder delta)
        {
            if (fileSystem == null) { throw new ArgumentNullException("fileSystem"); }
            if (String.IsNullOrEmpty(filename)) { throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Cannot_Be_Null_Or_Empty, "filename"), "filename"); }
            if (compression == null) { throw new ArgumentNullException("compression"); }
            if (index == null) { throw new ArgumentNullException("index"); }
            if (delta == null) { throw new ArgumentNullException("delta"); }

            FileSystem = fileSystem;
            PackFileName = filename;
            Compression = compression;
            Index = index;
            Delta = delta;
        }
Exemplo n.º 3
0
        public static GitPackFile Open(IFileSystem fs, string baseName)
        {
            if (fs == null)
            {
                throw new ArgumentNullException("fs");
            }
            if (String.IsNullOrEmpty(baseName))
            {
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Cannot_Be_Null_Or_Empty, "baseName"), "baseName");
            }

            return(new GitPackFile(
                       fs,
                       baseName + ".pack",
                       new ZlibCompressionStrategy(),
                       GitPackIndex.Open(fs, baseName + ".idx"),
                       new GitDeltaDecoder()));
        }