Skip to content

Commit

Permalink
Merge pull request #179 from BIBSYSDEV/mattiahj-patch-1
Browse files Browse the repository at this point in the history
Update maven-central.yml and fixed a bunch of javadoc errors.
  • Loading branch information
mattiahj committed Mar 9, 2021
2 parents 374cde5 + 8041dc7 commit 524edff
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
run: ./gradlew signMavenJavaPublication closeAndReleaseSonatypeStagingRepository
run: ./gradlew signMavenJavaPublication publishToSonatype closeAndReleaseSonatypeStagingRepository
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,6 @@ protected void writeUnexpectedFailure(I input, Exception exception, String reque

/**
* Add a function that adds headers to the response.
* <p>
* Example:
* <pre>
* {@code
*
* @Override
* protected String processInput(String input, RequestInfo requestInfo, Context context) throws Exception {
*
* byte[] md5 = DigestUtils.md5(input);
* addAdditionalHeaders(
* () -> Collections.singletonMap(HttpHeaders.CONTENT_MD5, new String(md5))
* );
* String output = input;
* return output;
* }
* }
* </pre>
* </p>
*
* @param additionalHeaders A supplier.
*/
Expand Down Expand Up @@ -175,8 +157,10 @@ protected Map<String, String> getSuccessHeaders() {
* another additional message.
*
* @param exception the thrown Exception.
* @param statusCode the statusCode that should be returned to the API-client
* @param statusCode the statusCode that should be returned to the API-client.
* @param requestId the id of the request that caused the exception.
* @throws IOException when the writer throws an IOException.
* @throws GatewayResponseSerializingException when the writer throws an GatewayResponseSerializingException.
*/

protected void writeFailure(Exception exception, Integer statusCode, String requestId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URISyntaxException;
import nva.commons.apigateway.exceptions.ApiGatewayException;
import nva.commons.apigateway.exceptions.GatewayResponseSerializingException;
import nva.commons.apigateway.exceptions.InvalidOrMissingTypeException;
Expand Down Expand Up @@ -114,8 +113,6 @@ protected void init(OutputStream outputStream, Context context) {
* fields during the processing
* @param context the Context
* @return an output object of class O
* @throws IOException when processing fails
* @throws URISyntaxException when processing fails
* @throws ApiGatewayException when some predictable error happens.
*/
protected O processInput(I input, String apiGatewayInputString, Context context) throws ApiGatewayException {
Expand Down
5 changes: 0 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ allprojects {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

// Needed because our javadoc contains a bunch of errors. TODO: Fix these errors.
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/nva/commons/core/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public Optional<String> readEnvOpt(String variableName) {
* Read an Environment variable.
*
* @param variableName the Env variable name.
* @return the value of the variable or throw {@IllegalStateException} if the variable does not exists.
* @return the value of the variable or throw IllegalStateException if the variable does not exists.
*/
public String readEnv(String variableName) {
return readEnvOpt(variableName).orElseThrow(() -> variableNotSetException(variableName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ private SingletonCollector() {
* @param <T> The type of input elements to the reduction operation.
* @param <E> The type of the exception to be thrown.
* @return A type of the singleton.
* @throws E If the input list is empty or contains more than one element.
*/
public static <T, E extends Exception> Collector<T, ?, Try<T>> tryCollect() {
return Collectors.collectingAndThen(Collectors.toList(), list -> attempt(() -> get(list)));
Expand Down
5 changes: 3 additions & 2 deletions core/src/main/java/nva/commons/core/attempt/Success.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ public Optional<T> toOptional() {
}

/**
* A wrapper for consumers that throw checked Exceptions. See {@see https://www.oreilly.com/content/handling
* -checked-exceptions-in-java-streams/} Try to perform the action. Any exception will be enclosed in a Failure.
* A wrapper for consumers that throw checked Exceptions.
* See "https://www.oreilly.com/content/handling-checked-exceptions-in-java-streams/"
* Try to perform the action. Any exception will be enclosed in a Failure.
*
* @param action a {@link Consumer} action that throws or does not throw a checked Exception
* @param <E> the type of the thrown Exception
Expand Down
10 changes: 6 additions & 4 deletions core/src/main/java/nva/commons/core/attempt/Try.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ public static <T> Try<T> of(T input) {
}

/**
* A wrapper for actions that throw checked Exceptions. See {@see https://www.oreilly.com/content/handling
* -checked-exceptions-in-java-streams/} Try to perform the action. Any exception will be enclosed in a Failure.
* A wrapper for actions that throw checked Exceptions.
* See: "https://www.oreilly.com/content/handling-checked-exceptions-in-java-streams"
* Try to perform the action. Any exception will be enclosed in a Failure.
*
* @param action a {@link Callable} action that throws or does not throw a checked Exception
* @param <S> the resulting object
Expand All @@ -36,8 +37,9 @@ public static <S> Try<S> attempt(Callable<S> action) {
}

/**
* A wrapper for functions that throw checked Exceptions. See {@see https://www.oreilly.com/content/handling
* -checked-exceptions-in-java-streams/} Try to perform the action. Any exception will be enclosed in a Failure.
* A wrapper for functions that throw checked Exceptions.
* See: "https://www.oreilly.com/content/handling-checked-exceptions-in-java-streams"
* Try to perform the action. Any exception will be enclosed in a Failure.
*
* @param fe a {@link FunctionWithException} function that throws or does not throw a checked Exception
* @param <T> the type of the argument of the function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

/**
* Abstract class for implementing a Request Authorizer. Implementation is based on the AWS examples found in the
* following page : {@see
* <a href=https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html>}.
* following page : "https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer
* .html".
*/

public abstract class RequestAuthorizer extends RestRequestHandler<Void, AuthorizerResponse> {
Expand Down Expand Up @@ -94,8 +94,12 @@ protected void writeUnexpectedFailure(Void input, Exception exception, String re
* allowed to. It can contain wildcards.
*
* <p>Example methodARN:
* arn:aws:execute-api:eu-west-1:884807050265:2lcqynkwke/Prod/GET/some/path/to/resource Example output:
* arn:aws:execute-api:eu-west-1:884807050265:2lcqynkwke/Prod\/*\/* <br/> Another possible output is: "*"
* arn:aws:execute-api:eu-west-1:884807050265:2lcqynkwke/Prod/GET/some/path/to/resource
* Example output:
* arn:aws:execute-api:eu-west-1:884807050265:2lcqynkwke/Prod\/*\/*
*
* Another possible output is: "*"
*</p>
*
* @param methodArn the method ARN as provided by the API gateway
* @return a resource for the policy
Expand Down

0 comments on commit 524edff

Please sign in to comment.