@@ -0,0 +1,1413 @@
+package pt.up.fe.sdis.proj1.utils;%0A%0Aimport java.io.IOException;%0Aimport java.nio.charset.StandardCharsets;%0Aimport java.nio.file.FileSystems;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.attribute.BasicFileAttributes;%0Aimport java.security.MessageDigest;%0Aimport java.security.NoSuchAlgorithmException;%0A%0Apublic class File %7B%0A    public File(String myAddr, String path) throws IOException,%0A            NoSuchAlgorithmException %7B%0A        java.io.File file = new java.io.File(path);%0A        _absolutePath = file.getAbsolutePath();%0A        %0A        Path filePath = FileSystems.getDefault()%0A                .getPath(_absolutePath);%0A        %0A        BasicFileAttributes attr = Files.readAttributes(filePath,%0A                BasicFileAttributes.class);%0A%0A        %0A        _lastModifiedTime = attr.lastModifiedTime().toString();%0A        _ownerIP = myAddr;%0A        _fileSize = attr.size();%0A%0A        MessageDigest digest = MessageDigest.getInstance(%22SHA-256%22);%0A        String text = _ownerIP + _absolutePath + _lastModifiedTime;%0A        _fileId = digest.digest(text.getBytes(StandardCharsets.UTF_8));%0A    %7D%0A%0A    public byte%5B%5D getFileId() %7B%0A        return _fileId;%0A    %7D%0A    %0A    public long getFileSize() %7B %0A        return _fileSize;%0A    %7D%0A%0A    byte%5B%5D _fileId;%0A%0A    private String _absolutePath;%0A    private String _lastModifiedTime;%0A    private String _ownerIP;%0A    %0A    private long _fileSize;%0A%7D%0A

Implement File class to calculate hashes.