Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage] Remove unused code for Track1 SDK #24415

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ public string Container
[Parameter(HelpMessage = "Force to overwrite the existing file.")]
public SwitchParameter Force { get; set; }

protected override bool UseTrack2Sdk()
{
return true;
}

/// <summary>
/// Initializes a new instance of the RemoveStorageAzureBlobCommand class.
/// </summary>
Expand Down
4 changes: 0 additions & 4 deletions src/Storage/Storage/Blob/Cmdlet/GetAzureStorageBlobByTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ public int? MaxCount

// Overwrite the useless parameter
public override string TagCondition { get; set; }
protected override bool UseTrack2Sdk()
{
return true;
}

/// <summary>
/// Initializes a new instance of the GetAzureStorageBlobByTagCommand class.
Expand Down
21 changes: 0 additions & 21 deletions src/Storage/Storage/Blob/Cmdlet/NewAzureStorageBlobSasToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@ public string Policy
public override int? ConcurrentTaskCount { get; set; }
public override string TagCondition { get; set; }

protected override bool UseTrack2Sdk()
{
return true;
}

/// <summary>
/// Initializes a new instance of the NewAzureStorageBlobSasCommand class.
/// </summary>
Expand Down Expand Up @@ -259,22 +254,6 @@ private string GetBlobSharedAccessSignature(CloudBlob blob, SharedAccessBlobPoli
}
}

/// <summary>
/// Update the access policy
/// </summary>
/// <param name="accessPolicy">Access policy object</param>
/// <param name="shouldSetExpiryTime">Should set the default expiry time</param>
private void SetupAccessPolicy(SharedAccessBlobPolicy accessPolicy, bool shouldSetExpiryTime)
{
AccessPolicyHelper.SetupAccessPolicyPermission(accessPolicy, Permission);
DateTimeOffset? accessStartTime;
DateTimeOffset? accessEndTime;
SasTokenHelper.SetupAccessPolicyLifeTime(StartTime, ExpiryTime,
out accessStartTime, out accessEndTime, shouldSetExpiryTime);
accessPolicy.SharedAccessStartTime = accessStartTime;
accessPolicy.SharedAccessExpiryTime = accessEndTime;
}

/// <summary>
/// Get CloudBlob object by name
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ public string Policy
public override int? ClientTimeoutPerRequest { get; set; }
public override int? ConcurrentTaskCount { get; set; }
public override string TagCondition { get; set; }
protected override bool UseTrack2Sdk()
{
return true;
}

/// <summary>
/// Initializes a new instance of the NewAzureStorageContainerSasCommand class.
Expand Down Expand Up @@ -173,21 +169,5 @@ public override void ExecuteCmdlet()
WriteObject(sasToken);
}
}

/// <summary>
/// Update the access policy
/// </summary>
/// <param name="policy">Access policy object</param>
/// <param name="shouldSetExpiryTime">Should set the default expiry time</param>
private void SetupAccessPolicy(SharedAccessBlobPolicy policy, bool shouldSetExpiryTime)
{
DateTimeOffset? accessStartTime;
DateTimeOffset? accessEndTime;
SasTokenHelper.SetupAccessPolicyLifeTime(StartTime, ExpiryTime,
out accessStartTime, out accessEndTime, shouldSetExpiryTime);
policy.SharedAccessStartTime = accessStartTime;
policy.SharedAccessExpiryTime = accessEndTime;
AccessPolicyHelper.SetupAccessPolicyPermission(policy, Permission);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ public class NewAzureStorageContainerStoredAccessPolicyCommand : StorageCloudBlo

[Parameter(HelpMessage = "Expiry Time")]
public DateTime? ExpiryTime { get; set; }

protected override bool UseTrack2Sdk()
{
return true;
}

// Overwrite the useless parameter
public override string TagCondition { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ public string Container
}
private string ContainerName = String.Empty;



protected override bool UseTrack2Sdk()
{
return true;
}

/// <summary>
/// Initializes a new instance of the RemoveStorageAzureBlobCommand class.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ public string PolicyMode
}
private BlobImmutabilityPolicyMode? policyMode = null;

protected override bool UseTrack2Sdk()
{
return true;
}

/// <summary>
/// Initializes a new instance of the RemoveStorageAzureBlobCommand class.
/// </summary>
Expand Down
5 changes: 0 additions & 5 deletions src/Storage/Storage/Blob/Cmdlet/SetAzStorageBlobLegalHold.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ public string Container
[Parameter(HelpMessage = "Disable LegalHold on the Blob.", Mandatory = true, ParameterSetName = BlobPipelineDisableParameterSet)]
public SwitchParameter DisableLegalHold { get; set; }

protected override bool UseTrack2Sdk()
{
return true;
}

/// <summary>
/// Initializes a new instance of the RemoveStorageAzureBlobCommand class.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ public class SetAzureStorageContainerStoredAccessPolicyCommand : StorageCloudBlo
[Parameter(HelpMessage = "Set ExpiryTime as null for the policy")]
public SwitchParameter NoExpiryTime { get; set; }

protected override bool UseTrack2Sdk()
{
return true;
}

// Overwrite the useless parameter
public override string TagCondition { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ public class NewAzureStorageAccountSasTokenCommand : StorageCloudBlobCmdletBase
public override int? ConcurrentTaskCount { get; set; }
public override string TagCondition { get; set; }

protected override bool UseTrack2Sdk()
{
return true;
}

/// <summary>
/// Initializes a new instance of the NewAzureStorageAccountSasTokenCommand class.
/// </summary>
Expand Down