コード例 #1
0
        public IHttpActionResult Get(Guid installationId)
        {
            var location = Config.StoreLocation;
            var store    = new SiteUpdateStore(location);

            return(Ok(store.GetUpdateSummaries(installationId)));
        }
コード例 #2
0
 public SiteUpdateWorker(IServiceProvider services, IntervalWorkerConfiguration config, Guid sourceId) :
     base(services, config)
 {
     _sourceId        = sourceId;
     _client          = services.GetRequiredService <HttpClient>();
     _siteUpdateStore = services.GetRequiredService <SiteUpdateStore>();
     _db    = services.GetRequiredService <Database>();
     _clock = services.GetRequiredService <IClock>();
 }
コード例 #3
0
        protected override void OnInit(EventArgs e)
        {
            var location       = SiteUpdateConfigurationSection.GetSection().StoreLocation;
            var installationId = InstallationInformationFacade.InstallationId;

            _store   = new SiteUpdateStore(location);
            _updates = _store.GetUpdateSummaries(installationId);

            base.OnInit(e);
        }
コード例 #4
0
        protected override void OnInit(EventArgs e)
        {
            var location       = SiteUpdateConfigurationSection.GetSection().StoreLocation;
            var store          = new SiteUpdateStore(location);
            var installationId = InstallationInformationFacade.InstallationId;
            var updates        = store.GetUpdateSummaries(installationId);

            Update = updates.Single(u => u.Id == Guid.Parse(Request.QueryString["package"]));

            base.OnInit(e);
        }
コード例 #5
0
        public HttpResponseMessage GetStream(Guid installationId, Guid updateId)
        {
            var location = Config.StoreLocation;
            var store    = new SiteUpdateStore(location);
            var updates  = store.GetUpdateSummaries(installationId);
            var update   = updates.Single(u => u.Id == updateId);

            var result = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StreamContent(store.GetZipStream(update))
            };

            result.Content.Headers.ContentType        = new MediaTypeHeaderValue("application/zip");
            result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
            {
                FileName = update.FileName
            };

            return(result);
        }
コード例 #6
0
 public SiteController(SiteUpdateStore store)
 {
     _store = store;
 }