Example #1
0
  private Album getAlbumInfo(String rowKey, String tableName) {
    try {
      CloudTableClient tableClient = getTableClient();
      Album specificAlbum =
          tableClient
              .execute(tableName, TableOperation.retrieve("1", rowKey, Album.class))
              .getResultAsType();

      return specificAlbum;
    } catch (StorageException storageException) {
      System.out.print("StorageException encountered: ");
      System.out.println(storageException.getMessage());
      return null;
    } catch (Exception e) {
      System.out.print("Exception encountered:\n");
      System.out.println(
          "Exception class: "
              + e.getClass()
              + "\nException message: "
              + e.getMessage()
              + "\nStack trace: "
              + e.getStackTrace());
      return null;
    }
  }
Example #2
0
 private void removeEntry(String rowKey, String tableName) {
   try {
     CloudTableClient tableClient = getTableClient();
     Album specificAlbum =
         tableClient
             .execute(tableName, TableOperation.retrieve("1", rowKey, Album.class))
             .getResultAsType();
     tableClient.execute(tableName, TableOperation.delete(specificAlbum));
   } catch (Exception e) {
     System.out.print("Exception encountered: ");
     System.out.println(e.getMessage());
   }
 }