@Test public void getApiKey() throws G3GalleryException { String apiKey = itemClient.getApiKey(); assertNotNull(apiKey); }
public String getApiKey() throws G3GalleryException { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("user", username)); nameValuePairs.add(new BasicNameValuePair("password", password)); String jsonResult = sendHttpRequest(INDEX_PHP_REST, nameValuePairs, POST, null); String key = ItemUtils.convertJsonResultToApiKey(jsonResult); if(!key.matches("[a-fA-F0-9]+")){ throw new G3GalleryException("The Gallery returned an unexpected result when trying to login; please check for info on the ReGalAndroid project page"); } return key; }
G3Client implements IG3Client { public String getApiKey() throws G3GalleryException { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("user", username)); nameValuePairs.add(new BasicNameValuePair("password", password)); String jsonResult = sendHttpRequest(INDEX_PHP_REST, nameValuePairs, POST, null); String key = ItemUtils.convertJsonResultToApiKey(jsonResult); if(!key.matches("[a-fA-F0-9]+")){ throw new G3GalleryException("The Gallery returned an unexpected result when trying to login; please check for info on the ReGalAndroid project page"); } return key; } }
G3Client implements IG3Client { public String getApiKey() throws G3GalleryException { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("user", username)); nameValuePairs.add(new BasicNameValuePair("password", password)); String jsonResult = sendHttpRequest(INDEX_PHP_REST, nameValuePairs, POST, null); String key = ItemUtils.convertJsonResultToApiKey(jsonResult); if(!key.matches("[a-fA-F0-9]+")){ throw new G3GalleryException("The Gallery returned an unexpected result when trying to login; please check for info on the ReGalAndroid project page"); } return key; } G3Client(String galleryUrl, String userAgent); }
G3Client implements IG3Client { public String getApiKey() throws G3GalleryException { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("user", username)); nameValuePairs.add(new BasicNameValuePair("password", password)); String jsonResult = sendHttpRequest(INDEX_PHP_REST, nameValuePairs, POST, null); String key = ItemUtils.convertJsonResultToApiKey(jsonResult); if(!key.matches("[a-fA-F0-9]+")){ throw new G3GalleryException("The Gallery returned an unexpected result when trying to login; please check for info on the ReGalAndroid project page"); } return key; } G3Client(String galleryUrl, String userAgent); Item getItem(int itemId); int createItem(Entity entity, File file); void updateItem(Entity entity); void deleteItem(int itemId); String getApiKey(); List<Item> getAlbumAndSubAlbumsAndPictures(int albumId); List<Item> getAlbumAndSubAlbums(int albumId); List<Item> getPictures(int albumId); InputStream getPhotoInputStream(String url); void setPassword(String password); void setUsername(String username); void setExistingApiKey(String existingApiKey); String getExistingApiKey(); boolean isUsingRewrittenUrls(); void setUsingRewrittenUrls(boolean isUsingRewrittenUrls); }
G3Client implements IG3Client { public String getApiKey() throws G3GalleryException { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("user", username)); nameValuePairs.add(new BasicNameValuePair("password", password)); String jsonResult = sendHttpRequest(INDEX_PHP_REST, nameValuePairs, POST, null); String key = ItemUtils.convertJsonResultToApiKey(jsonResult); if(!key.matches("[a-fA-F0-9]+")){ throw new G3GalleryException("The Gallery returned an unexpected result when trying to login; please check for info on the ReGalAndroid project page"); } return key; } G3Client(String galleryUrl, String userAgent); Item getItem(int itemId); int createItem(Entity entity, File file); void updateItem(Entity entity); void deleteItem(int itemId); String getApiKey(); List<Item> getAlbumAndSubAlbumsAndPictures(int albumId); List<Item> getAlbumAndSubAlbums(int albumId); List<Item> getPictures(int albumId); InputStream getPhotoInputStream(String url); void setPassword(String password); void setUsername(String username); void setExistingApiKey(String existingApiKey); String getExistingApiKey(); boolean isUsingRewrittenUrls(); void setUsingRewrittenUrls(boolean isUsingRewrittenUrls);  }