Package com.azure.data.tables.sas
Class TableAccountSasService
- java.lang.Object
-
- com.azure.data.tables.sas.TableAccountSasService
-
public final class TableAccountSasService extends Object
This is a helper class to construct a string representing the services accessible by an Account SAS. Setting a value to true means that any SAS which uses these permissions will grant access to that service. Once all the values are set, this should be serialized withtoString()and set as the services field on anTableAccountSasSignatureValuesobject. It is possible to construct the services string without this class, but the order of the services is particular and this class guarantees correctness.
-
-
Constructor Summary
Constructors Constructor Description TableAccountSasService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasBlobAccess()booleanhasFileAccess()booleanhasQueueAccess()booleanhasTableAccess()static TableAccountSasServiceparse(String servicesString)Creates anTableAccountSasServicefrom the specified services string.TableAccountSasServicesetBlobAccess(boolean blob)Sets the access status for blob resources.TableAccountSasServicesetFileAccess(boolean file)Sets the access status for file resources.TableAccountSasServicesetQueueAccess(boolean queue)Sets the access status for queue resources.TableAccountSasServicesetTableAccess(boolean table)Sets the access status for table resources.StringtoString()Converts the given services to aString.
-
-
-
Method Detail
-
parse
public static TableAccountSasService parse(String servicesString)
Creates anTableAccountSasServicefrom the specified services string. This method will throw anIllegalArgumentExceptionif it encounters a character that does not correspond to a valid service.- Parameters:
servicesString- AStringwhich represents theaccount services.- Returns:
- A
TableAccountSasServicegenerated from the givenString. - Throws:
IllegalArgumentException- IfservicesStringcontains a character other than b, f, q, or t.
-
hasBlobAccess
public boolean hasBlobAccess()
- Returns:
- The access status for blob resources.
-
setBlobAccess
public TableAccountSasService setBlobAccess(boolean blob)
Sets the access status for blob resources.- Parameters:
blob- The access status to set.- Returns:
- The updated
TableAccountSasServiceobject.
-
hasFileAccess
public boolean hasFileAccess()
- Returns:
- The access status for file resources.
-
setFileAccess
public TableAccountSasService setFileAccess(boolean file)
Sets the access status for file resources.- Parameters:
file- The access status to set.- Returns:
- The updated
TableAccountSasServiceobject.
-
hasQueueAccess
public boolean hasQueueAccess()
- Returns:
- The access status for queue resources.
-
setQueueAccess
public TableAccountSasService setQueueAccess(boolean queue)
Sets the access status for queue resources.- Parameters:
queue- The access status to set.- Returns:
- The updated
TableAccountSasServiceobject.
-
hasTableAccess
public boolean hasTableAccess()
- Returns:
- The access status for table resources.
-
setTableAccess
public TableAccountSasService setTableAccess(boolean table)
Sets the access status for table resources.- Parameters:
table- The access status to set.- Returns:
- The updated
TableAccountSasServiceobject.
-
toString
public String toString()
Converts the given services to aString. Using this method will guarantee the services are in an order accepted by the service. If all services are set to false, an empty string is returned from this method.- Overrides:
toStringin classObject- Returns:
- A
Stringwhich represents theaccount services.
-
-