示例#1
0
        public void CopyApplicationPackage(string connectionEndpoint, string applicationPackagePath, string imageStoreConnectionString, string relativeDestinationPath, string certThumbprint)
        {
            IImageStore imageStore = CreateImageStore(connectionEndpoint, imageStoreConnectionString, Path.GetTempPath(), certThumbprint);

            if (string.IsNullOrEmpty(relativeDestinationPath))
            {
                relativeDestinationPath = new DirectoryInfo(applicationPackagePath).Name;
            }

            ImageBuilderUtility.ValidateRelativePath(relativeDestinationPath);

            imageStore.UploadContent(
                relativeDestinationPath,
                applicationPackagePath,
                AzureCliProxy.DefaultTimeSpan,
                CopyFlag.AtomicCopy,
                false);
        }
示例#2
0
        internal bool ValidateImageStorePath(string path)
        {
            string[] reservedDirectoryNames = new string[]
            {
                Constants.StoreFolder,
                Constants.WindowsFabricStoreFolder
            };

            try
            {
                ImageBuilderUtility.ValidateRelativePath(
                    path,
                    reservedDirectoryNames);
            }
            catch (FabricImageBuilderReservedDirectoryException ex)
            {
                return(this.ShouldContinue(ex.Message, string.Empty));
            }

            return(true);
        }