Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba13897a authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

change calcul of hash for file in SynchronizableFileInfo

parent 7e1c148e
Loading
Loading
Loading
Loading
+31 −22
Original line number Diff line number Diff line
@@ -85,14 +85,22 @@ public class SynchronizableFileInfo implements ISynchronizableContent {
            Log.e(TAG, "Exception while getting digest", e);
            return null;
        }
        if(!file.exists()){
            return null;
        }


        InputStream is;
        if(file.isFile()) {
            try {
                is = new FileInputStream(file);
            } catch (FileNotFoundException e) {
                Log.e(TAG, "Exception while getting FileInputStream", e);
                return null;
            }
    /*else {
            //TODO gérer le hash d'un dossier!
        }*/
            byte[] buffer = new byte[8192];
            int read;
            try {
@@ -113,5 +121,6 @@ public class SynchronizableFileInfo implements ISynchronizableContent {
                    Log.e(TAG, "Exception on closing MD5 input stream", e);
                }
            }
        }return null;
    }
}