Commit 8ff298d0 authored by Viktor Porvaznik's avatar Viktor Porvaznik Committed by Viktor Porvaznik

Added more logging #3

parent a08a2dfb
...@@ -90,8 +90,8 @@ public class FileSyncPlugin extends Plugin { ...@@ -90,8 +90,8 @@ public class FileSyncPlugin extends Plugin {
} }
if (!errorOccured && np.getType().equals(PACKET_TYPE_FILESYNC_HASH_REQUEST)) { if (!errorOccured && np.getType().equals(PACKET_TYPE_FILESYNC_HASH_REQUEST)) {
Log.i("FileSyncPlugin", "Hash request received.");
List<String> fileList = np.getStringList("fileList"); List<String> fileList = np.getStringList("fileList");
Log.i("FileSyncPlugin", "Hash request received; list: " + fileList.toString());
JSONArray hashArray = new JSONArray(); JSONArray hashArray = new JSONArray();
if (fileList.size() == 0) { if (fileList.size() == 0) {
...@@ -102,8 +102,11 @@ public class FileSyncPlugin extends Plugin { ...@@ -102,8 +102,11 @@ public class FileSyncPlugin extends Plugin {
try { try {
fileHash.put("filePath", filePath); fileHash.put("filePath", filePath);
if (new File(filePath).exists()) { if (new File(filePath).exists()) {
fileHash.put("hash", convertStringToHash(getFileContents(filePath))); String hash = convertStringToHash(getFileContents(filePath));
Log.d("FileSyncPlugin", "Obtaining file hash for: " + filePath + "; hash: " + hash);
fileHash.put("hash", hash);
} else { } else {
Log.d("FileSyncPlugin", "Can not obtain file hash for: " + filePath + "; file does not exist");
fileHash.put("hash", ""); fileHash.put("hash", "");
} }
} catch (JSONException e) { } catch (JSONException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment