diff --git a/eclipse_codeformatter.xml b/eclipse_codeformatter.xml index 2b2b4a809..f087b31eb 100644 --- a/eclipse_codeformatter.xml +++ b/eclipse_codeformatter.xml @@ -1,380 +1,504 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/exception/SortParameterUnsupportedDirectionException.java b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/exception/SortParameterUnsupportedDirectionException.java index 8626c35a8..95e593bcc 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/exception/SortParameterUnsupportedDirectionException.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/exception/SortParameterUnsupportedDirectionException.java @@ -26,7 +26,7 @@ public class SortParameterUnsupportedDirectionException extends AbstractServerRt * Creates a new SortParameterSyntaxErrorException with {@link SpServerError#SP_REST_SORT_PARAM_INVALID_DIRECTION} error. * * @param cause the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates - * that the cause is nonexistent or unknown.) + * that the cause is nonexistent or unknown.) */ public SortParameterUnsupportedDirectionException(final Throwable cause) { super(SpServerError.SP_REST_SORT_PARAM_INVALID_DIRECTION, cause); diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/exception/SortParameterUnsupportedFieldException.java b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/exception/SortParameterUnsupportedFieldException.java index d62ffb9f5..7bce03f3e 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/exception/SortParameterUnsupportedFieldException.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/exception/SortParameterUnsupportedFieldException.java @@ -26,7 +26,7 @@ public class SortParameterUnsupportedFieldException extends AbstractServerRtExce * Creates a new SortParameterSyntaxErrorException with {@link SpServerError#SP_REST_SORT_PARAM_INVALID_FIELD} error. * * @param cause the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates - * that the cause is nonexistent or unknown.) + * that the cause is nonexistent or unknown.) */ public SortParameterUnsupportedFieldException(final Throwable cause) { super(SpServerError.SP_REST_SORT_PARAM_INVALID_FIELD, cause); diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtility.java b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtility.java index 988b52467..d68a55e6e 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtility.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtility.java @@ -15,10 +15,10 @@ import java.util.StringTokenizer; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterUnsupportedDirectionException; -import org.eclipse.hawkbit.repository.RsqlQueryField; import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterSyntaxErrorException; +import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterUnsupportedDirectionException; import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterUnsupportedFieldException; +import org.eclipse.hawkbit.repository.RsqlQueryField; import org.springframework.data.domain.Sort.Direction; import org.springframework.data.domain.Sort.Order; diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtilityTest.java b/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtilityTest.java index 8d49c5dd2..f67244e1e 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtilityTest.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtilityTest.java @@ -17,10 +17,10 @@ import java.util.List; import io.qameta.allure.Description; import io.qameta.allure.Feature; import io.qameta.allure.Story; -import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterUnsupportedDirectionException; -import org.eclipse.hawkbit.repository.TargetFields; import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterSyntaxErrorException; +import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterUnsupportedDirectionException; import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterUnsupportedFieldException; +import org.eclipse.hawkbit.repository.TargetFields; import org.junit.jupiter.api.Test; import org.springframework.data.domain.Sort.Order; diff --git a/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/RestConfiguration.java b/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/RestConfiguration.java index 49e02f627..ee8100a2e 100644 --- a/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/RestConfiguration.java +++ b/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/RestConfiguration.java @@ -215,7 +215,8 @@ public class RestConfiguration { * @return the entity to be responded containing the exception information as entity. */ @ExceptionHandler(ConstraintViolationException.class) - public ResponseEntity handleConstraintViolationException(final HttpServletRequest request, final ConstraintViolationException ex) { + public ResponseEntity handleConstraintViolationException(final HttpServletRequest request, + final ConstraintViolationException ex) { logRequest(request, ex); final ExceptionInfo response = new ExceptionInfo(); diff --git a/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileStreamingUtil.java b/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileStreamingUtil.java index ac143d827..37eeb4889 100644 --- a/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileStreamingUtil.java +++ b/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileStreamingUtil.java @@ -367,6 +367,22 @@ public final class FileStreamingUtil { return total; } + /** + * Listener for progress on artifact file streaming. + */ + @FunctionalInterface + public interface FileStreamingProgressListener { + + /** + * Called multiple times during streaming. + * + * @param requestedBytes requested bytes of the request + * @param shippedBytesSinceLast since the last report + * @param shippedBytesOverall during the request + */ + void progress(long requestedBytes, long shippedBytesSinceLast, long shippedBytesOverall); + } + private static final class ByteRange { private static final String MULTIPART_BOUNDARY = "THIS_STRING_SEPARATES_MULTIPART"; @@ -442,20 +458,4 @@ public final class FileStreamingUtil { } } - - /** - * Listener for progress on artifact file streaming. - */ - @FunctionalInterface - public interface FileStreamingProgressListener { - - /** - * Called multiple times during streaming. - * - * @param requestedBytes requested bytes of the request - * @param shippedBytesSinceLast since the last report - * @param shippedBytesOverall during the request - */ - void progress(long requestedBytes, long shippedBytesSinceLast, long shippedBytesOverall); - } }