getContent(Path)   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 3
c 1
b 0
f 0
cc 1
rs 10
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