Skip to content

Commit

Permalink
Addressed API Feedback for Storage STG77 (#22023)
Browse files Browse the repository at this point in the history
  • Loading branch information
gapra-msft committed Jun 4, 2021
1 parent a466b3d commit 71e63f7
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ public BlobContainerSasPermission() {
* Creates an {@code BlobContainerSasPermission} from the specified permissions string. This method will throw an
* {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission.
*
* @param permString A {@code String} which represents the {@code BlobContainerSasPermission}.
* @param permissionString A {@code String} which represents the {@code BlobContainerSasPermission}.
* @return A {@code BlobContainerSasPermission} generated from the given {@code String}.
* @throws IllegalArgumentException If {@code permString} contains a character other than r, a, c, w, d, x, l or t.
* @throws IllegalArgumentException If {@code permissionString} contains a character other than r, a, c, w, d, x, l or t.
*/
public static BlobContainerSasPermission parse(String permString) {
public static BlobContainerSasPermission parse(String permissionString) {
BlobContainerSasPermission permissions = new BlobContainerSasPermission();

for (int i = 0; i < permString.length(); i++) {
char c = permString.charAt(i);
for (int i = 0; i < permissionString.length(); i++) {
char c = permissionString.charAt(i);
switch (c) {
case 'r':
permissions.readPermission = true;
Expand Down Expand Up @@ -88,7 +88,7 @@ public static BlobContainerSasPermission parse(String permString) {
default:
throw new IllegalArgumentException(
String.format(Locale.ROOT, Constants.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE,
"Permissions", permString, c));
"Permissions", permissionString, c));
}
}
return permissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ public BlobSasPermission() {
* Creates a {@code BlobSasPermission} from the specified permissions string. This method will throw an
* {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission.
*
* @param permString A {@code String} which represents the {@code BlobSasPermission}.
* @param permissionString A {@code String} which represents the {@code BlobSasPermission}.
* @return A {@code BlobSasPermission} generated from the given {@code String}.
* @throws IllegalArgumentException If {@code permString} contains a character other than r, a, c, w, d, x, l, t,
* @throws IllegalArgumentException If {@code permissionString} contains a character other than r, a, c, w, d, x, l, t,
* m, or e.
*/
public static BlobSasPermission parse(String permString) {
public static BlobSasPermission parse(String permissionString) {
BlobSasPermission permissions = new BlobSasPermission();

for (int i = 0; i < permString.length(); i++) {
char c = permString.charAt(i);
for (int i = 0; i < permissionString.length(); i++) {
char c = permissionString.charAt(i);
switch (c) {
case 'r':
permissions.readPermission = true;
Expand Down Expand Up @@ -89,7 +89,7 @@ public static BlobSasPermission parse(String permString) {
default:
throw new IllegalArgumentException(
String.format(Locale.ROOT, Constants.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE,
"Permissions", permString, c));
"Permissions", permissionString, c));
}
}
return permissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ public AccountSasPermission() {
* Creates an {@link AccountSasPermission} from the specified permissions string. This method will throw an {@link
* IllegalArgumentException} if it encounters a character that does not correspond to a valid permission.
*
* @param permString A {@code String} which represents the {@link AccountSasPermission}.
* @param permissionString A {@code String} which represents the {@link AccountSasPermission}.
*
* @return An {@link AccountSasPermission} object generated from the given {@link String}.
*
* @throws IllegalArgumentException If {@code permString} contains a character other than r, w, d, x, l, a, c, u, p,
* @throws IllegalArgumentException If {@code permissionString} contains a character other than r, w, d, x, l, a, c, u, p,
* t or f.
*/
public static AccountSasPermission parse(String permString) {
public static AccountSasPermission parse(String permissionString) {
AccountSasPermission permissions = new AccountSasPermission();

for (int i = 0; i < permString.length(); i++) {
char c = permString.charAt(i);
for (int i = 0; i < permissionString.length(); i++) {
char c = permissionString.charAt(i);
switch (c) {
case 'r':
permissions.readPermission = true;
Expand Down Expand Up @@ -104,7 +104,7 @@ public static AccountSasPermission parse(String permString) {
default:
throw new IllegalArgumentException(
String.format(Locale.ROOT, Constants.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE,
"Permissions", permString, c));
"Permissions", permissionString, c));
}
}
return permissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

package com.azure.storage.file.datalake.models;

import com.azure.core.annotation.Fluent;

/**
* signed identifier.
*/
@Fluent
public class DataLakeSignedIdentifier {
/*
* a unique id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ public FileSystemSasPermission() {
* Creates an {@code FileSystemSasPermission} from the specified permissions string. This method will throw an
* {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission.
*
* @param permString A {@code String} which represents the {@code FileSystemSasPermission}.
* @param permissionString A {@code String} which represents the {@code FileSystemSasPermission}.
* @return A {@code FileSystemSasPermission} generated from the given {@code String}.
* @throws IllegalArgumentException If {@code permString} contains a character other than r, a, c, w, d, l, m, e,
* @throws IllegalArgumentException If {@code permissionString} contains a character other than r, a, c, w, d, l, m, e,
* o, or p.
*/
public static FileSystemSasPermission parse(String permString) {
public static FileSystemSasPermission parse(String permissionString) {
FileSystemSasPermission permissions = new FileSystemSasPermission();

for (int i = 0; i < permString.length(); i++) {
char c = permString.charAt(i);
for (int i = 0; i < permissionString.length(); i++) {
char c = permissionString.charAt(i);
switch (c) {
case 'r':
permissions.readPermission = true;
Expand Down Expand Up @@ -89,7 +89,7 @@ public static FileSystemSasPermission parse(String permString) {
default:
throw new IllegalArgumentException(
String.format(Locale.ROOT, Constants.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE,
"Permissions", permString, c));
"Permissions", permissionString, c));
}
}
return permissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ public PathSasPermission() {
* Creates a {@code PathSasPermission} from the specified permissions string. This method will throw an
* {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission.
*
* @param permString A {@code String} which represents the {@code PathSasPermission}.
* @param permissionString A {@code String} which represents the {@code PathSasPermission}.
* @return A {@code PathSasPermission} generated from the given {@code String}.
* @throws IllegalArgumentException If {@code permString} contains a character other than r, a, c, w, d, l, m, e,
* @throws IllegalArgumentException If {@code permissionString} contains a character other than r, a, c, w, d, l, m, e,
* o, or p.
*/
public static PathSasPermission parse(String permString) {
public static PathSasPermission parse(String permissionString) {
PathSasPermission permissions = new PathSasPermission();

for (int i = 0; i < permString.length(); i++) {
char c = permString.charAt(i);
for (int i = 0; i < permissionString.length(); i++) {
char c = permissionString.charAt(i);
switch (c) {
case 'r':
permissions.readPermission = true;
Expand Down Expand Up @@ -90,7 +90,7 @@ public static PathSasPermission parse(String permString) {
default:
throw new IllegalArgumentException(
String.format(Locale.ROOT, Constants.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE,
"Permissions", permString, c));
"Permissions", permissionString, c));
}
}
return permissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ public ShareFileSasPermission() {
* Creates an {@code ShareFileSasPermission} from the specified permissions string. This method will throw an
* {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission.
*
* @param permString A {@code String} which represents the {@code ShareFileSasPermission}.
* @param permissionString A {@code String} which represents the {@code ShareFileSasPermission}.
* @return A {@code ShareFileSasPermission} generated from the given {@code String}.
* @throws IllegalArgumentException If {@code permString} contains a character other than r, c, w, or d.
* @throws IllegalArgumentException If {@code permissionString} contains a character other than r, c, w, or d.
*/
public static ShareFileSasPermission parse(String permString) {
public static ShareFileSasPermission parse(String permissionString) {
ShareFileSasPermission permissions = new ShareFileSasPermission();

for (int i = 0; i < permString.length(); i++) {
char c = permString.charAt(i);
for (int i = 0; i < permissionString.length(); i++) {
char c = permissionString.charAt(i);
switch (c) {
case 'r':
permissions.readPermission = true;
Expand All @@ -66,7 +66,7 @@ public static ShareFileSasPermission parse(String permString) {
default:
throw new IllegalArgumentException(
String.format(Locale.ROOT, Constants.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE,
"Permissions", permString, c));
"Permissions", permissionString, c));
}
}
return permissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ShareSasPermission() {
*
* @param permissionString A {@code String} which represents the {@code ShareSasPermission}.
* @return A {@code ShareSasPermission} generated from the given {@code String}.
* @throws IllegalArgumentException If {@code permString} contains a character other than r, c, w, d, or l.
* @throws IllegalArgumentException If {@code permissionString} contains a character other than r, c, w, d, or l.
*/
public static ShareSasPermission parse(String permissionString) {
ShareSasPermission permissions = new ShareSasPermission();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public QueueSasPermission() {
* Creates a {@link QueueSasPermission} from the specified permissions string. This method will throw an
* {@link IllegalArgumentException} if it encounters a character that does not correspond to a valid permission.
*
* @param permString A {@code String} which represents the {@code QueueSasPermission}.
* @param permissionString A {@code String} which represents the {@code QueueSasPermission}.
* @return A {@code QueueSasPermission} generated from the given {@code String}.
* @throws IllegalArgumentException If {@code permString} contains a character other than r, a, u, or p.
* @throws IllegalArgumentException If {@code permissionString} contains a character other than r, a, u, or p.
*/
public static QueueSasPermission parse(String permString) {
public static QueueSasPermission parse(String permissionString) {
QueueSasPermission permissions = new QueueSasPermission();

for (int i = 0; i < permString.length(); i++) {
char c = permString.charAt(i);
for (int i = 0; i < permissionString.length(); i++) {
char c = permissionString.charAt(i);
switch (c) {
case 'r':
permissions.readPermission = true;
Expand All @@ -67,7 +67,7 @@ public static QueueSasPermission parse(String permString) {
default:
throw new IllegalArgumentException(
String.format(Locale.ROOT, Constants.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE,
"Permissions", permString, c));
"Permissions", permissionString, c));
}
}
return permissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ public AccountSASPermission() {
* Creates an {@code AccountSASPermission} from the specified permissions string. This method will throw an
* {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission.
*
* @param permString
* @param permissionString
* A {@code String} which represents the {@code SharedAccessAccountPermissions}.
*
* @return An {@code AccountSASPermission} object generated from the given {@code String}.
*/
public static AccountSASPermission parse(String permString) {
public static AccountSASPermission parse(String permissionString) {
AccountSASPermission permissions = new AccountSASPermission();

for (int i = 0; i < permString.length(); i++) {
char c = permString.charAt(i);
for (int i = 0; i < permissionString.length(); i++) {
char c = permissionString.charAt(i);
switch (c) {
case 'r':
permissions.read = true;
Expand Down Expand Up @@ -77,7 +77,7 @@ public static AccountSASPermission parse(String permString) {
break;
default:
throw new IllegalArgumentException(
String.format(Locale.ROOT, SR.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE, "Permissions", permString, c));
String.format(Locale.ROOT, SR.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE, "Permissions", permissionString, c));
}
}
return permissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ public BlobSASPermission() {
* Creates a {@code BlobSASPermission} from the specified permissions string. This method will throw an
* {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission.
*
* @param permString
* @param permissionString
* A {@code String} which represents the {@code BlobSASPermission}.
*
* @return A {@code BlobSASPermission} generated from the given {@code String}.
*/
public static BlobSASPermission parse(String permString) {
public static BlobSASPermission parse(String permissionString) {
BlobSASPermission permissions = new BlobSASPermission();

for (int i = 0; i < permString.length(); i++) {
char c = permString.charAt(i);
for (int i = 0; i < permissionString.length(); i++) {
char c = permissionString.charAt(i);
switch (c) {
case 'r':
permissions.read = true;
Expand All @@ -62,7 +62,7 @@ public static BlobSASPermission parse(String permString) {
break;
default:
throw new IllegalArgumentException(
String.format(Locale.ROOT, SR.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE, "Permissions", permString, c));
String.format(Locale.ROOT, SR.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE, "Permissions", permissionString, c));
}
}
return permissions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ public ContainerSASPermission() {
* Creates an {@code ContainerSASPermission} from the specified permissions string. This method will throw an
* {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission.
*
* @param permString
* @param permissionString
* A {@code String} which represents the {@code ContainerSASPermission}.
*
* @return A {@code ContainerSASPermission} generated from the given {@code String}.
*/
public static ContainerSASPermission parse(String permString) {
public static ContainerSASPermission parse(String permissionString) {
ContainerSASPermission permissions = new ContainerSASPermission();

for (int i = 0; i < permString.length(); i++) {
char c = permString.charAt(i);
for (int i = 0; i < permissionString.length(); i++) {
char c = permissionString.charAt(i);
switch (c) {
case 'r':
permissions.read = true;
Expand All @@ -67,7 +67,7 @@ public static ContainerSASPermission parse(String permString) {
break;
default:
throw new IllegalArgumentException(
String.format(Locale.ROOT, SR.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE, "Permissions", permString, c));
String.format(Locale.ROOT, SR.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE, "Permissions", permissionString, c));
}
}
return permissions;
Expand Down

0 comments on commit 71e63f7

Please sign in to comment.