diff --git a/README.md b/README.md index 47405d3f..8355fa95 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ An API key is required to use this API. You can [request one on Flickr](http:// #### Required libraries -- [scribejava-api (v 6.9.0 onwards)](https://github.com/scribejava/scribejava) (required for the OAuth functionality) +- [scribejava-api (v8.3.3 onwards)](https://github.com/scribejava/scribejava) (required for the OAuth functionality) - [SLF4J](https://www.slf4j.org) (runtime dependency for logging) [See here](https://www.slf4j.org/manual.html#swapping) for details on how to choose and configure an SLF4J logging library. @@ -76,3 +76,10 @@ Run tests as follows. Expect lots of failures and general flakiness as data has changed on Flickr and the tests or data need updating. +### Dependency checker + +[OWASP dependency-check](https://github.com/jeremylong/DependencyCheck) is configured in the pom.xml. + +To run a dependency check + + mvn -U clean verify -P dependency-check diff --git a/config/dependencyCheckSuppression.xml b/config/dependencyCheckSuppression.xml new file mode 100644 index 00000000..f1524955 --- /dev/null +++ b/config/dependencyCheckSuppression.xml @@ -0,0 +1,4 @@ + + + + diff --git a/pom.xml b/pom.xml index e00b2143..9286e503 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.flickr4java @@ -11,20 +12,20 @@ https://github.com/boncey/Flickr4Java - - boncey - Darren Greaves - - developer - - - - callmeal - Allan - - developer - - + + boncey + Darren Greaves + + developer + + + + callmeal + Allan + + developer + + @@ -37,9 +38,12 @@ 1.8 - 4.13.1 - 1.7.30 - 6.9.0 + 4.13.2 + 2.0.5 + 8.3.3 + config/dependencyCheckSuppression.xml + 8.2.1 + @@ -133,7 +137,7 @@ jar - -Xdoclint:none + -Xdoclint:none @@ -182,13 +186,21 @@ + org.apache.maven.plugins maven-javadoc-plugin + 3.2.0 + + 8 + attach-javadocs jar + + -Xdoclint:none + @@ -233,6 +245,33 @@ + + dependency-check + + false + + + + + org.owasp + dependency-check-maven + ${dependency.check.version} + + ${dependency.check.suppression.file} + true + + + + package + + check + + + + + + + diff --git a/src/main/java/com/flickr4java/flickr/REST.java b/src/main/java/com/flickr4java/flickr/REST.java index a16198c3..785f4318 100644 --- a/src/main/java/com/flickr4java/flickr/REST.java +++ b/src/main/java/com/flickr4java/flickr/REST.java @@ -8,6 +8,7 @@ import com.flickr4java.flickr.util.IOUtilities; import com.flickr4java.flickr.util.OAuthUtilities; import com.flickr4java.flickr.util.UrlUtilities; +import com.github.scribejava.core.httpclient.multipart.FileByteArrayBodyPartPayload; import com.github.scribejava.core.model.OAuth1AccessToken; import com.github.scribejava.core.model.OAuthRequest; import com.github.scribejava.core.model.Parameter; @@ -227,9 +228,8 @@ public com.flickr4java.flickr.Response postMultiPart(String path, UploadMetaData // Ensure all parameters (including oauth) are added to payload so signature matches uploadParameters.putAll(request.getOauthParameters()); - request.addFileByteArrayBodyPartPayloadInMultipartPayload(payload.getPayload(), "photo", metaData.getFilename()); - uploadParameters.entrySet().forEach(e -> - request.addFileByteArrayBodyPartPayloadInMultipartPayload(null, e.getValue().getBytes(), e.getKey())); + request.addBodyPartPayloadInMultipartPayload(new FileByteArrayBodyPartPayload(payload.getPayload(), "photo", metaData.getFilename())); + uploadParameters.forEach((param, uploadPayload) -> request.addBodyPartPayloadInMultipartPayload(new FileByteArrayBodyPartPayload(uploadPayload.getBytes(), param))); try { return handleResponse(request, service); diff --git a/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java b/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java index bccde79d..8ea93448 100644 --- a/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java +++ b/src/main/java/com/flickr4java/flickr/groups/discuss/GroupDiscussInterface.java @@ -11,13 +11,13 @@ import java.util.HashMap; import java.util.Map; +/** + * Group.Discuss Interface. + * + * @author Jonathan Willis + */ public class GroupDiscussInterface { - /** - * Group.Discuss Interface. - * - * @author Jonathan Willis - */ public static final String METHOD_TOPICS_GET_LIST = "flickr.groups.discuss.topics.getList"; public static final String METHOD_TOPICS_GET_INFO = "flickr.groups.discuss.topics.getInfo";