Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import org.jetbrains.annotations.NotNull;
  2.  
  3. import java.io.IOException;
  4. import java.nio.file.Files;
  5. import java.nio.file.Path;
  6.  
  7. public class TargetFile {
  8. @NotNull
  9. public final String name;
  10. @NotNull
  11. public final String content;
  12.  
  13. public TargetFile(@NotNull String name, @NotNull String content) {
  14. this.name = name;
  15. this.content = content;
  16. }
  17.  
  18. public TargetFile(@NotNull Path path) throws IOException {
  19. this.name = path.toFile().toString();
  20. this.content = new String(Files.readAllBytes(path));
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement