16
16
* </code>
17
17
*/
18
18
public class EPLiteClient {
19
- private static final String DEFAULT_API_VERSION = "1.2.12 " ;
19
+ private static final String DEFAULT_API_VERSION = "1.2.13 " ;
20
20
private static final String DEFAULT_ENCODING = "UTF-8" ;
21
21
private final EPLiteConnection connection ;
22
22
@@ -129,7 +129,8 @@ public Map listAllGroups() {
129
129
}
130
130
131
131
// Authors
132
- // These authors are bound to the attributes the users choose (color and name). The author id is returned in "authorID".
132
+ // These authors are bound to the attributes the users choose (color and name).
133
+ // The author id is returned in "authorID".
133
134
134
135
/**
135
136
* Create a new author.
@@ -153,7 +154,8 @@ public Map createAuthor(String name) {
153
154
}
154
155
155
156
/**
156
- * Creates a new Author for authorMapper if one doesn't already exist. Helps you map your application's authors to Etherpad Lite's authors.
157
+ * Creates a new Author for authorMapper if one doesn't already exist.
158
+ * Helps you map your application's authors to Etherpad Lite's authors.
157
159
* The author id is returned in "authorID".
158
160
*
159
161
* @param authorMapper string
@@ -166,7 +168,8 @@ public Map createAuthorIfNotExistsFor(String authorMapper) {
166
168
}
167
169
168
170
/**
169
- * Creates a new Author for authorMapper if one doesn't already exist. Helps you map your application's authors to Etherpad Lite's authors.
171
+ * Creates a new Author for authorMapper if one doesn't already exist.
172
+ * Helps you map your application's authors to Etherpad Lite's authors.
170
173
* The author id is returned in "authorID".
171
174
*
172
175
* @param authorMapper string
@@ -363,7 +366,7 @@ public Map getText(String padId, long rev) {
363
366
}
364
367
365
368
/**
366
- * Creates a new revision with the given text (or creates a new pad) .
369
+ * Creates a new revision with the given text.
367
370
*
368
371
* @param padId the pad's id string
369
372
* @param text the pad's new text
@@ -375,6 +378,21 @@ public void setText(String padId, String text) {
375
378
this .connection .post ("setText" , args );
376
379
}
377
380
381
+ /**
382
+ * Creates a new revision with the given text appended to the existing text.
383
+ *
384
+ * API >= 1.2.13
385
+ *
386
+ * @param padId the pad's id string
387
+ * @param text the pad's new text
388
+ */
389
+ public void appendText (String padId , String text ) {
390
+ Map <String ,Object > args = new HashMap <>();
391
+ args .put ("padID" , padId );
392
+ args .put ("text" , text );
393
+ this .connection .post ("appendText" , args );
394
+ }
395
+
378
396
/**
379
397
* Returns a Map containing the current revision of the pad's text as HTML.
380
398
* The html is stored under "html".
@@ -404,7 +422,7 @@ public Map getHTML(String padId, long rev) {
404
422
}
405
423
406
424
/**
407
- * Creates a new revision with the given html (or creates a new pad) .
425
+ * Creates a new revision with the given html.
408
426
*
409
427
* @param padId the pad's id string
410
428
* @param html the pad's new html text
0 commit comments