From 292abd92969781029c59c8b92e59425d1349e0f1 Mon Sep 17 00:00:00 2001 From: Justin hart Date: Fri, 15 Sep 2023 13:12:32 -0700 Subject: [PATCH] finished assignment 3 --- .idea/misc.xml | 1 - src/HiddenSecrets.java | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index cf9abe6..b95853c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/src/HiddenSecrets.java b/src/HiddenSecrets.java index 71067b3..285d6a0 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 @@ -37,9 +40,13 @@ 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 scanner = new Scanner(System.in); + System.out.println("hey please input at file path"); + String file = scanner.nextLine(); + // read in a string from Syst // convert that string into A Path type using Paths class, + Path path = Paths.get(file); + getHiddenSecrets(path.toFile()); // and call the getHiddenSecrets method to get the file's meta-data // HERE }