Class Builders
java.lang.Object
org.apache.sling.api.request.builder.Builders
Creates builders.
- Since:
- 1.0 (Sling API Bundle 2.24.0)
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull SlingHttpServletRequestBuildernewRequestBuilder(@NotNull Resource resource) Creates a new request builder.static @NotNull RequestParameternewRequestParameter(@NotNull String name, byte @NotNull [] value, String fileName, String contentType) Creates a new binary request parameterstatic @NotNull RequestParameternewRequestParameter(@NotNull String name, @NotNull String value) Creates a newapplication/x-www-form-urlencodedrequest parameter with UTF-8 encodingstatic @NotNull RequestParameternewRequestParameter(@NotNull String name, @NotNull String value, @NotNull Charset encoding) Creates a newapplication/x-www-form-urlencodedrequest parameter with the given encodingstatic @NotNull RequestProgressTrackerCreates a new request progress trackerstatic @NotNull SlingHttpServletResponseBuilderCreates a new response builder.
-
Method Details
-
newRequestBuilder
@NotNull public static @NotNull SlingHttpServletRequestBuilder newRequestBuilder(@NotNull @NotNull Resource resource) Creates a new request builder.- Parameters:
resource- the resource on which the request is based- Returns:
- a request builder
- Throws:
IllegalArgumentException- If resource isnull
-
newResponseBuilder
Creates a new response builder.- Returns:
- a response builder
-
newRequestProgressTracker
Creates a new request progress tracker- Returns:
- a request progress tracker
- Since:
- 1.1 (Sling API Bundle 2.25.0)
-
newRequestParameter
@NotNull public static @NotNull RequestParameter newRequestParameter(@NotNull @NotNull String name, @NotNull @NotNull String value) Creates a newapplication/x-www-form-urlencodedrequest parameter with UTF-8 encoding- Parameters:
name- the parameter namevalue- the parameter value- Returns:
- a request parameter
- Since:
- 1.2 (Sling API Bundle 2.26.2)
-
newRequestParameter
@NotNull public static @NotNull RequestParameter newRequestParameter(@NotNull @NotNull String name, @NotNull @NotNull String value, @NotNull @NotNull Charset encoding) Creates a newapplication/x-www-form-urlencodedrequest parameter with the given encoding- Parameters:
name- the parameter namevalue- the parameter valueencoding- the charset of the value- Returns:
- a request parameter
- Since:
- 1.2 (Sling API Bundle 2.26.2)
-
newRequestParameter
@NotNull public static @NotNull RequestParameter newRequestParameter(@NotNull @NotNull String name, byte @NotNull [] value, String fileName, String contentType) Creates a new binary request parameter- Parameters:
name- the parameter namevalue- the parameter valuefileName- the file name (may benull)contentType- the content type (may benull)- Returns:
- a request parameter
- Since:
- 1.3 (Sling API Bundle 2.28.0)
-