Skip to content

Commit cd1cdce

Browse files
committed
SQ remarks
1 parent ed9c4a1 commit cd1cdce

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Sdk/CatalogService/HttpCatalogService.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,16 @@ public async Task<ArtifactUploadResult> RegisterCatalogAsync(byte[] catalogDetai
131131

132132
public async Task<ArtifactUploadResult> UploadVersionAsync(byte[] package, string fileName, string key, string catalogId, string version, string description, CancellationToken cancellationToken)
133133
{
134+
if (String.IsNullOrWhiteSpace(fileName)) throw new ArgumentNullException(nameof(fileName));
135+
if (String.IsNullOrWhiteSpace(key)) throw new ArgumentNullException(nameof(key));
136+
if (String.IsNullOrWhiteSpace(catalogId)) throw new ArgumentNullException(nameof(catalogId));
134137
if (String.IsNullOrWhiteSpace(version)) throw new ArgumentNullException(nameof(version));
135138

139+
return await UploadVersionInternalAsync(package, fileName, key, catalogId, version, description, cancellationToken);
140+
}
141+
142+
private async Task<ArtifactUploadResult> UploadVersionInternalAsync(byte[] package, string fileName, string key, string catalogId, string version, string description, CancellationToken cancellationToken)
143+
{
136144
string versionUploadPath = $"{VersionUploadPathStart}{catalogId}{VersionUploadPathEnd}";
137145
using (var formData = new MultipartFormDataContent())
138146
{
@@ -166,7 +174,9 @@ public async Task<ArtifactUploadResult> UploadVersionAsync(byte[] package, strin
166174
if (response.IsSuccessStatusCode)
167175
{
168176
var returnedResult = JsonConvert.DeserializeObject<CatalogUploadResult>(await response.Content.ReadAsStringAsync().ConfigureAwait(false));
169-
return new ArtifactUploadResult { ArtifactId = returnedResult.AzureStorageId };
177+
{
178+
return new ArtifactUploadResult { ArtifactId = returnedResult.AzureStorageId };
179+
}
170180
}
171181

172182
if (response.StatusCode is HttpStatusCode.Forbidden || response.StatusCode is HttpStatusCode.Unauthorized)

Sdk/Helpers/CatalogReferencesHelper.cs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public static bool TryResolveCatalogReferences(Project packageProject, out List<
1818
includedPackages = null;
1919
errorMessage = null;
2020

21-
string rootFolder = FileSystem.Instance.Directory.GetParentDirectory(packageProject.ProjectDirectory);
2221
const string xmlFileName = "CatalogReferences.xml";
2322
string xmlFilePath = FileSystem.Instance.Path.Combine(packageProject.ProjectDirectory, "PackageContent", xmlFileName);
2423

Sdk/Tasks/DmappCreation.cs

-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ private void PackageBasicFiles(PackageCreationData preparedData, AppPackage.AppP
247247

248248
// Include Dashboards
249249
IncludeFromPackageContent("Dashboards", ZipType.Dashboard);
250-
return;
251250

252251
void IncludeFromPackageContent(string contentFolderName, ZipType contentType)
253252
{

0 commit comments

Comments
 (0)