mirror of
https://github.com/Grace-Solutions/PSMinIO.git
synced 2026-08-28 12:56:52 +00:00
Fix all nullable reference warnings for clean build
✅ Resolved all CS8601, CS8603, and CS8604 warnings: • Fixed AdvancedMetadataHandler nullable assignments • Fixed MultipartUploadManager return value warning • Fixed cmdlet parameter warnings in GetMinIOBucket and GetMinIOObject • Fixed ZipArchiveBuilder substring warning ✅ Clean build achieved: • Zero compilation errors • Zero warnings • Enterprise-grade code quality • Full .NET Standard 2.0 compatibility All comprehensive MinIO features now compile cleanly with no warnings.
This commit is contained in:
@@ -64,7 +64,7 @@ namespace PSMinIO.Cmdlets
|
|||||||
{
|
{
|
||||||
var wildcardPattern = new WildcardPattern(BucketName, WildcardOptions.IgnoreCase);
|
var wildcardPattern = new WildcardPattern(BucketName, WildcardOptions.IgnoreCase);
|
||||||
buckets = buckets.Where(b => b.Name != null && wildcardPattern.IsMatch(b.Name)).ToList();
|
buckets = buckets.Where(b => b.Name != null && wildcardPattern.IsMatch(b.Name)).ToList();
|
||||||
WriteVerboseMessage("Filtered to {0} buckets matching pattern '{1}'", buckets.Count, BucketName!);
|
WriteVerboseMessage("Filtered to {0} buckets matching pattern '{1}'", buckets.Count, BucketName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enhance bucket information if requested
|
// Enhance bucket information if requested
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ namespace PSMinIO.Cmdlets
|
|||||||
{
|
{
|
||||||
var wildcardPattern = new WildcardPattern(Name, WildcardOptions.IgnoreCase);
|
var wildcardPattern = new WildcardPattern(Name, WildcardOptions.IgnoreCase);
|
||||||
objects = objects.Where(o => o.Name != null && wildcardPattern.IsMatch(o.Name)).ToList();
|
objects = objects.Where(o => o.Name != null && wildcardPattern.IsMatch(o.Name)).ToList();
|
||||||
WriteVerboseMessage("Filtered to {0} objects matching pattern '{1}'", objects.Count, Name!);
|
WriteVerboseMessage("Filtered to {0} objects matching pattern '{1}'", objects.Count, Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply directory filters
|
// Apply directory filters
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ namespace PSMinIO.Cmdlets
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(ResumeUploadId))
|
if (!string.IsNullOrEmpty(ResumeUploadId))
|
||||||
{
|
{
|
||||||
WriteVerboseMessage("Resuming upload with ID: {0}", ResumeUploadId);
|
WriteVerboseMessage("Resuming upload with ID: {0}", ResumeUploadId!);
|
||||||
if (CompletedParts != null && CompletedParts.Length > 0)
|
if (CompletedParts != null && CompletedParts.Length > 0)
|
||||||
{
|
{
|
||||||
WriteVerboseMessage("Found {0} completed parts", CompletedParts.Length);
|
WriteVerboseMessage("Found {0} completed parts", CompletedParts.Length);
|
||||||
|
|||||||
@@ -24,31 +24,31 @@ namespace PSMinIO.Core.S3
|
|||||||
// Content-Type
|
// Content-Type
|
||||||
if (!string.IsNullOrEmpty(metadata.ContentType))
|
if (!string.IsNullOrEmpty(metadata.ContentType))
|
||||||
{
|
{
|
||||||
headers["Content-Type"] = metadata.ContentType;
|
headers["Content-Type"] = metadata.ContentType!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Content-Encoding
|
// Content-Encoding
|
||||||
if (!string.IsNullOrEmpty(metadata.ContentEncoding))
|
if (!string.IsNullOrEmpty(metadata.ContentEncoding))
|
||||||
{
|
{
|
||||||
headers["Content-Encoding"] = metadata.ContentEncoding;
|
headers["Content-Encoding"] = metadata.ContentEncoding!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Content-Language
|
// Content-Language
|
||||||
if (!string.IsNullOrEmpty(metadata.ContentLanguage))
|
if (!string.IsNullOrEmpty(metadata.ContentLanguage))
|
||||||
{
|
{
|
||||||
headers["Content-Language"] = metadata.ContentLanguage;
|
headers["Content-Language"] = metadata.ContentLanguage!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Content-Disposition
|
// Content-Disposition
|
||||||
if (!string.IsNullOrEmpty(metadata.ContentDisposition))
|
if (!string.IsNullOrEmpty(metadata.ContentDisposition))
|
||||||
{
|
{
|
||||||
headers["Content-Disposition"] = metadata.ContentDisposition;
|
headers["Content-Disposition"] = metadata.ContentDisposition!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache-Control
|
// Cache-Control
|
||||||
if (!string.IsNullOrEmpty(metadata.CacheControl))
|
if (!string.IsNullOrEmpty(metadata.CacheControl))
|
||||||
{
|
{
|
||||||
headers["Cache-Control"] = metadata.CacheControl;
|
headers["Cache-Control"] = metadata.CacheControl!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expires
|
// Expires
|
||||||
@@ -60,49 +60,49 @@ namespace PSMinIO.Core.S3
|
|||||||
// Server-Side Encryption
|
// Server-Side Encryption
|
||||||
if (!string.IsNullOrEmpty(metadata.ServerSideEncryption))
|
if (!string.IsNullOrEmpty(metadata.ServerSideEncryption))
|
||||||
{
|
{
|
||||||
headers["x-amz-server-side-encryption"] = metadata.ServerSideEncryption;
|
headers["x-amz-server-side-encryption"] = metadata.ServerSideEncryption!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SSE-KMS Key ID
|
// SSE-KMS Key ID
|
||||||
if (!string.IsNullOrEmpty(metadata.SSEKMSKeyId))
|
if (!string.IsNullOrEmpty(metadata.SSEKMSKeyId))
|
||||||
{
|
{
|
||||||
headers["x-amz-server-side-encryption-aws-kms-key-id"] = metadata.SSEKMSKeyId;
|
headers["x-amz-server-side-encryption-aws-kms-key-id"] = metadata.SSEKMSKeyId!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SSE-C Algorithm
|
// SSE-C Algorithm
|
||||||
if (!string.IsNullOrEmpty(metadata.SSECustomerAlgorithm))
|
if (!string.IsNullOrEmpty(metadata.SSECustomerAlgorithm))
|
||||||
{
|
{
|
||||||
headers["x-amz-server-side-encryption-customer-algorithm"] = metadata.SSECustomerAlgorithm;
|
headers["x-amz-server-side-encryption-customer-algorithm"] = metadata.SSECustomerAlgorithm!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SSE-C Key
|
// SSE-C Key
|
||||||
if (!string.IsNullOrEmpty(metadata.SSECustomerKey))
|
if (!string.IsNullOrEmpty(metadata.SSECustomerKey))
|
||||||
{
|
{
|
||||||
headers["x-amz-server-side-encryption-customer-key"] = metadata.SSECustomerKey;
|
headers["x-amz-server-side-encryption-customer-key"] = metadata.SSECustomerKey!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SSE-C Key MD5
|
// SSE-C Key MD5
|
||||||
if (!string.IsNullOrEmpty(metadata.SSECustomerKeyMD5))
|
if (!string.IsNullOrEmpty(metadata.SSECustomerKeyMD5))
|
||||||
{
|
{
|
||||||
headers["x-amz-server-side-encryption-customer-key-MD5"] = metadata.SSECustomerKeyMD5;
|
headers["x-amz-server-side-encryption-customer-key-MD5"] = metadata.SSECustomerKeyMD5!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Storage Class
|
// Storage Class
|
||||||
if (!string.IsNullOrEmpty(metadata.StorageClass))
|
if (!string.IsNullOrEmpty(metadata.StorageClass))
|
||||||
{
|
{
|
||||||
headers["x-amz-storage-class"] = metadata.StorageClass;
|
headers["x-amz-storage-class"] = metadata.StorageClass!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Website Redirect Location
|
// Website Redirect Location
|
||||||
if (!string.IsNullOrEmpty(metadata.WebsiteRedirectLocation))
|
if (!string.IsNullOrEmpty(metadata.WebsiteRedirectLocation))
|
||||||
{
|
{
|
||||||
headers["x-amz-website-redirect-location"] = metadata.WebsiteRedirectLocation;
|
headers["x-amz-website-redirect-location"] = metadata.WebsiteRedirectLocation!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object Lock Mode
|
// Object Lock Mode
|
||||||
if (!string.IsNullOrEmpty(metadata.ObjectLockMode))
|
if (!string.IsNullOrEmpty(metadata.ObjectLockMode))
|
||||||
{
|
{
|
||||||
headers["x-amz-object-lock-mode"] = metadata.ObjectLockMode;
|
headers["x-amz-object-lock-mode"] = metadata.ObjectLockMode!;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Object Lock Retain Until Date
|
// Object Lock Retain Until Date
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ namespace PSMinIO.Core.S3
|
|||||||
throw new InvalidOperationException("Failed to initiate multipart upload - no upload ID returned");
|
throw new InvalidOperationException("Failed to initiate multipart upload - no upload ID returned");
|
||||||
}
|
}
|
||||||
|
|
||||||
return uploadId;
|
return uploadId!;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ namespace PSMinIO.Utils
|
|||||||
var fullPath = fileInfo.FullName;
|
var fullPath = fileInfo.FullName;
|
||||||
if (fullPath.StartsWith(basePath, StringComparison.OrdinalIgnoreCase))
|
if (fullPath.StartsWith(basePath, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var relativePath = fullPath.Substring(basePath!.Length).TrimStart('\\', '/');
|
var relativePath = fullPath.Substring(basePath.Length).TrimStart('\\', '/');
|
||||||
return relativePath.Replace('\\', '/'); // Use forward slashes for zip entries
|
return relativePath.Replace('\\', '/'); // Use forward slashes for zip entries
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user