es.webbeta.serializer.base.FileUtils   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 5
c 1
b 0
f 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getContent(Path) 0 3 1
1
package es.webbeta.serializer.base;
2
3
import java.io.IOException;
4
import java.nio.charset.StandardCharsets;
5
import java.nio.file.Files;
6
import java.nio.file.Path;
7
8
public class FileUtils {
0 ignored issues
show
Best Practice introduced by
This looks like a utility class. You may want to hide the implict public constructor behind a private one, so the class cannot be instantiated,
Loading history...
9
10
    public static String getContent(Path path) throws IOException {
11
        byte[] encoded = Files.readAllBytes(path);
12
        return new String(encoded, StandardCharsets.UTF_8);
13
    }
14
15
}
16