- Notifications
You must be signed in to change notification settings - Fork152
Java API For Flickr. Fork of FlickrJ
License
boncey/Flickr4Java
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Note: This API has been forked fromFlickrJ at Sourceforge.
This is a Java API which wraps theREST-based Flickr API.
Comments and questions should be raised on theGitHub Repo issue tracker.
To use the API just construct an instance of the classcom.flickr4java.flickr.test.Flickr and request the interfaces which you need to work with.
For example, to send a test ping to the Flickr service:
String apiKey = "YOUR_API_KEY";String sharedSecret = "YOUR_SHARED_SECRET";Flickr f = new Flickr(apiKey, sharedSecret, new REST());TestInterface testInterface = f.getTestInterface();Collection results = testInterface.echo(Collections.EMPTY_MAP);See/src/examples/java for more.
Since version 3.0.7 Flickr4Java passes the following User-Agent header in its requests
Flickr4Java/3.xIf you want to override that and set your own you can pass in your own value. Note that no validation is performed on the provided string.
REST transport = new REST();transport.setUserAgent("MyUserAgent/0.1");Flickr f = new Flickr(apiKey, sharedSecret, transport);This API has been tested and built with JDK 1.8.
An API key is required to use this API. You canrequest one on Flickr.
- scribejava-api (v8.3.3 onwards) (required for the OAuth functionality)
- SLF4J (runtime dependency for logging)
See here for details on how to choose and configure an SLF4J logging library.
compile 'com.flickr4java:flickr4java:3.0.9'<dependency> <groupId>com.flickr4java</groupId> <artifactId>flickr4java</artifactId> <version>3.0.9</version></dependency>Flickr4Java is available on Maven Central so the above settings should be all you need.
The tests now run against captured responses from Flickr (seesrc/test/resources/payloads) and don't contact the Flickr API at all.
This means there is no longer any need to create a test account and populate a properties file.
This is the setup to run the tests against the Flickr API.
Not for the faint-hearted. Only do this to test large refactorings etc.
Create up asetup.properties file (seesrc/test/resources/setup.properties.example) with details of a real account on Flickr (I recommend setting up a test account for this purpose).
Run tests as follows.
mvn -DsetupPropertiesPath=/path/to/your/setup.properties clean installExpect lots of failures and general flakiness as data has changed on Flickr and the tests or data need updating.
OWASP dependency-check is configured in the pom.xml.
To run a dependency check
mvn -U clean verify -P dependency-checkAbout
Java API For Flickr. Fork of FlickrJ
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.