protected override void ReadData(
            Endpoint endpoint,
            PipelineStep pipelineStep,
            PipelineContext pipelineContext)
        {
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (pipelineStep == null)
            {
                throw new ArgumentNullException(nameof(pipelineStep));
            }
            if (pipelineContext == null)
            {
                throw new ArgumentNullException(nameof(pipelineContext));
            }
            var logger = pipelineContext.PipelineBatchContext.Logger;
            //
            //get the file path from the plugin on the endpoint
            var settings = endpoint.GetDropboxSettings();

            if (settings == null)
            {
                return;
            }
            if (string.IsNullOrWhiteSpace(settings.DropboxUrl))
            {
                logger.Error(
                    "No Dropbox Url or Files Directory is specified on the endpoint. " +
                    "(pipeline step: {0}, endpoint: {1})",
                    pipelineStep.Name, endpoint.Name);
                return;
            }


            DownloadAndUnzipHelper.Run(settings.DropboxUrl);

            logger.Info("All files updated successfully");
        }
Exemplo n.º 2
0
        public void CheckUrl()
        {
            var url = DownloadAndUnzipHelper.FixLink("http://sdf");

            Assert.AreEqual(url, "http://sdf/?dl=1");
        }