diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordRepository.java b/app/src/main/java/com/zeapo/pwdstore/PasswordRepository.java index 75e65144..cdbcb3b0 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordRepository.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordRepository.java @@ -60,6 +60,10 @@ public class PasswordRepository { return mainPasswordMap; } + public static File getFile(String name) { + return new File(repository.getWorkTree() + "/" + name); + } + public static ArrayList getFilesList(File path){ List files = (List) FileUtils.listFiles(path, new String[] {"gpg"}, true); ArrayList filePaths = new ArrayList(); diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 9e45b38a..8bbdcb4e 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -31,6 +31,7 @@ import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.IOException; import java.util.Collection; import java.util.List; @@ -115,7 +116,15 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI /* If an item is clicked in the list of passwords, this will be triggered */ @Override public void onFragmentInteraction(String id) { - System.out.println(id + " Clicked"); + + try { + for (String l : (List) FileUtils.readLines(PasswordRepository.getFile(id), null)) { + System.out.println(l); + } + } catch (IOException e) { + //TODO handle problems + e.printStackTrace(); + } } }