Skip to content

Commit 31c4742

Browse files
committed
♻️ Minor refactoring
1 parent 600ef6a commit 31c4742

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,4 @@ $RECYCLE.BIN/
286286
### infer ###
287287
# infer- http://fbinfer.com/
288288
infer-out
289-
/commons/nbproject/
290-
291-
rebel.xml
289+
/commons/nbproject/

commons/src/main/java/org/restheart/utils/DirectoryWatcher.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020
*/
2121
package org.restheart.utils;
2222

23-
import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
24-
import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE;
25-
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;
26-
2723
import java.io.IOException;
2824
import java.nio.file.FileSystems;
2925
import java.nio.file.Files;
3026
import java.nio.file.Path;
27+
import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
28+
import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE;
29+
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;
3130
import java.nio.file.WatchEvent;
3231
import java.nio.file.WatchEvent.Kind;
3332
import java.nio.file.WatchKey;
@@ -78,6 +77,7 @@ private void registerDirectoryAndSubdirectories(Path dir) throws IOException {
7877
}
7978

8079
@Override
80+
@SuppressWarnings("unchecked")
8181
public void run() {
8282
while (true) {
8383
WatchKey key;

core/src/main/java/org/restheart/services/PingService.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@ public void setup() {
5454
@Override
5555
public void handle(final ByteArrayRequest request, final ByteArrayResponse response) throws Exception {
5656
if (request.isGet()) {
57-
final StringBuilder pingMessageBuilder = new StringBuilder();
57+
final var pingMessageBuilder = new StringBuilder();
5858
if (this.isExtendedResponseEnabled) {
5959
pingMessageBuilder.append("{\"message\": \"")
60-
.append(msg)
61-
.append("\", \"client_ip\": \"")
62-
.append(getClientIp(request.getExchange()))
63-
.append("\", \"host\": \"")
64-
.append(getHostHeader(request.getExchange()))
65-
.append("\", \"version\": \"")
66-
.append(VERSION)
67-
.append("\"}");
60+
.append(msg)
61+
.append("\", \"client_ip\": \"")
62+
.append(getClientIp(request.getExchange()))
63+
.append("\", \"host\": \"")
64+
.append(getHostHeader(request.getExchange()))
65+
.append("\", \"version\": \"")
66+
.append(VERSION)
67+
.append("\"}");
6868
} else {
6969
pingMessageBuilder.append("{\"message\": \"")
70-
.append(msg)
71-
.append("\"}");
70+
.append(msg)
71+
.append("\"}");
7272
}
7373

7474
final String pingMessage = pingMessageBuilder.toString();

0 commit comments

Comments
 (0)