Keep editor javadoc for files
@@ -31,6 +31,10 @@ public class Editor {
private final String name;
private final LineEditor editor;
+ /**
+ * Read the file which must be encoded in UTF-8, use the LineEditor to edit it,
+ * and any modifications were done write it back and return true.
+ */
public Editor(Path path, LineEditor editor) {
this(path.toString(),
() -> uncheck(() -> Files.readAllLines(path, ENCODING)),
@@ -76,7 +80,8 @@ public class Editor {
case NONE:
newLines.add(line);
break;
- default: throw new IllegalArgumentException("Unknown EditType " + edit.getType());
+ default:
+ throw new IllegalArgumentException("Unknown EditType " + edit.getType());
}
if (!edit.appendLines().isEmpty()) {
