summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordRepository.java4
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordStore.java11
2 files changed, 14 insertions, 1 deletions
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<String> getFilesList(File path){
List<File> files = (List<File>) FileUtils.listFiles(path, new String[] {"gpg"}, true);
ArrayList<String> filePaths = new ArrayList<String>();
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<String>) FileUtils.readLines(PasswordRepository.getFile(id), null)) {
+ System.out.println(l);
+ }
+ } catch (IOException e) {
+ //TODO handle problems
+ e.printStackTrace();
+ }
}
}