Skip to content

Commit 2df12eb

Browse files
authored
Void Write Methods (#124)
* void write methods * void write methods * Update pom.xml
1 parent ab99458 commit 2df12eb

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

avaje-jex-static-content/src/main/java/io/avaje/jex/staticcontent/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* Static Content API - see {@link io.avaje.jex.staticcontent.StaticContentService}.
33
*
44
* <pre>{@code
5-
* var staticContent = StaticContentService.createCP("/public").directoryIndex("index.html");
5+
* var staticContent = StaticContentService.createCP("/public").httpPath("/").directoryIndex("index.html");
66
* final Jex.Server app = Jex.create()
7-
* .routing(staticContent.createService())
7+
* .routing(staticContent)
88
* .port(8080)
99
* .start();
1010
*

avaje-jex-static-content/src/main/java/module-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* Defines the Static Content API for serving static resources with Jex - see {@link io.avaje.jex.staticcontent.StaticContentService}.
33
*
44
* <pre>{@code
5-
* var staticContent = StaticContentService.createCP("/public").directoryIndex("index.html");
5+
* var staticContent = StaticContentService.createCP("/public").httpPath("/").directoryIndex("index.html");
66
* final Jex.Server app = Jex.create()
7-
* .routing(staticContent.createService())
7+
* .routing(staticContent)
88
* .port(8080)
99
* .start();
1010
*

avaje-jex/src/main/java/io/avaje/jex/Context.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,54 +246,54 @@ default String userAgent() {
246246
int status();
247247

248248
/** Write plain text content to the response. */
249-
Context text(String content);
249+
void text(String content);
250250

251251
/** Write html content to the response. */
252-
Context html(String content);
252+
void html(String content);
253253

254254
/**
255255
* Set the content type as application/json and write the response.
256256
*
257257
* @param bean the object to serialize and write
258258
*/
259-
Context json(Object bean);
259+
void json(Object bean);
260260

261261
/**
262262
* Write the stream as a JSON stream with new line delimiters {@literal
263263
* application/x-json-stream}.
264264
*
265265
* @param stream The stream of beans to write as json
266266
*/
267-
<E> Context jsonStream(Stream<E> stream);
267+
<E> void jsonStream(Stream<E> stream);
268268

269269
/**
270270
* Write the stream as a JSON stream with new line delimiters {@literal
271271
* application/x-json-stream}.
272272
*
273273
* @param iterator The iterator of beans to write as json
274274
*/
275-
<E> Context jsonStream(Iterator<E> iterator);
275+
<E> void jsonStream(Iterator<E> iterator);
276276

277277
/**
278278
* Writes the given string content directly to the response.
279279
*
280280
* @param content The string content to write.
281281
*/
282-
Context write(String content);
282+
void write(String content);
283283

284284
/**
285285
* Writes the given bytes directly to the response.
286286
*
287287
* @param bytes The byte array to write.
288288
*/
289-
Context write(byte[] bytes);
289+
void write(byte[] bytes);
290290

291291
/**
292292
* Writes the content from the given InputStream directly to the response body.
293293
*
294294
* @param is The input stream containing the content to write.
295295
*/
296-
Context write(InputStream is);
296+
void write(InputStream is);
297297

298298
/**
299299
* Return the outputStream to write content. It is expected that

0 commit comments

Comments
 (0)