From f7bca8a0815376daed9a45ccb59786b345932e81 Mon Sep 17 00:00:00 2001 From: FinnCl4rk Date: Tue, 12 Sep 2023 13:34:30 -0700 Subject: [PATCH] Done with assignment 3 --- .idea/misc.xml | 2 +- src/HiddenSecrets.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index cf9abe6..501ce09 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/HiddenSecrets.java b/src/HiddenSecrets.java index 71067b3..fba3a70 100644 --- a/src/HiddenSecrets.java +++ b/src/HiddenSecrets.java @@ -7,6 +7,9 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Scanner; // PUT YOUR IMPORTS HERE @@ -39,6 +42,11 @@ public static void getHiddenSecrets(File file) { public static void main(String[] args) { // Put your code to request a file path, // read in a string from System.in, + Scanner S = new Scanner(System.in); + System.out.println("Insert file path"); + String filePath = S.nextLine(); + Path path = Paths.get(filePath); + getHiddenSecrets(path.toFile()); // convert that string into A Path type using Paths class, // and call the getHiddenSecrets method to get the file's meta-data // HERE