Example #1
0
 public ReleaseService(IFeedLocator feedLocator)
 {
     if (feedLocator == null)
     {
         throw new ArgumentNullException("feedLocator");
     }
     _feedLocator = feedLocator;
 }
Example #2
0
        public Feed(FeedConfiguration configuration, IFeedLocator feedLocator)
            : this(feedLocator)
        {
            if (string.IsNullOrEmpty(configuration.PublicPath) || !Directory.Exists(configuration.PublicPath))
                throw new DirectoryNotFoundException(string.Format("Directory not found: {0}", configuration.PublicPath));

            Id = configuration.Id;
            Packages.AddRange(
                Directory.EnumerateFiles(configuration.PrivatePath, "*.nupkg").Select(
                    path => new Package(path, _feedLocator)));
            Packages.AddRange(
                Directory.EnumerateFiles(configuration.PublicPath, "*.nupkg").Select(
                    path => new Package(path, _feedLocator)));
        }
Example #3
0
        public Feed(FeedConfiguration configuration, IFeedLocator feedLocator) : this(feedLocator)
        {
            if (string.IsNullOrEmpty(configuration.PublicPath) || !Directory.Exists(configuration.PublicPath))
            {
                throw new DirectoryNotFoundException(string.Format("Directory not found: {0}", configuration.PublicPath));
            }

            Id = configuration.Id;
            Packages.AddRange(
                Directory.EnumerateFiles(configuration.PrivatePath, "*.nupkg").Select(
                    path => new Package(path, _feedLocator)));
            Packages.AddRange(
                Directory.EnumerateFiles(configuration.PublicPath, "*.nupkg").Select(
                    path => new Package(path, _feedLocator)));
        }
Example #4
0
        public Package(string path, IFeedLocator feedLocator) : this(feedLocator)
        {
            if (!File.Exists(path))
            {
                throw new FileNotFoundException(path);
            }
            string filename = System.IO.Path.GetFileName(path);
            Debug.Assert(filename != null, "filename != null");

            if (!PackageRegex.IsMatch(filename))
            {
                throw new ArgumentException(string.Format("Filename does not match regex: {0}", filename));
            }
            Match match = PackageRegex.Match(filename);

            Id       = match.Groups[1].Value;
            Version  = match.Groups[2].Value;
            Path     = path;
            Created  = File.GetCreationTimeUtc(path);
            Modified = File.GetLastWriteTimeUtc(path);
        }
Example #5
0
 public Feed(IFeedLocator feedLocator)
 {
     _feedLocator = feedLocator;
     Packages = new List<Package>();
 }
Example #6
0
 public ReleaseService(IFeedLocator feedLocator)
 {
     if (feedLocator == null)
         throw new ArgumentNullException("feedLocator");
     _feedLocator = feedLocator;
 }
Example #7
0
 public Feed(IFeedLocator feedLocator)
 {
     _feedLocator = feedLocator;
     Packages     = new List <Package>();
 }
Example #8
0
 public Package(IFeedLocator feedLocator)
 {
     _feedLocator = feedLocator;
 }