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/README.md b/README.md index 4d9f4d9..c436dd1 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,20 @@ Your assignment is to use Built-In java classes to: * Look at the getHiddenSecrets method and identify the following parts by editing this README.md and providing your answers: * What is the **access modifer** (e.g. public, private, protected)? + * Public * Is it a **Class method** or an **object Instance method**, how do you know? + * Because its static, it is a method * What is its **return data-type**? + * The return type is void * Does it require any **arguments** to call it, and if so, how many **parameters** and of what **data-type**? + * It needs 1 type of file * Scan line by line through the code and try to determine how it works? * What is familiar to you? + * Sout is the only thing familiar to me * What is not familiar to you? + * try is the newest thing to me * Do the **for** loops make sense, and if so, tell me what you think they do? + * They do not make too much sense right now because I am still learning about what needs to be done. ## PART 4 - Turn in diff --git a/images/img.png b/images/img.png new file mode 100644 index 0000000..a67dd8e Binary files /dev/null and b/images/img.png differ diff --git a/src/HiddenSecrets.java b/src/HiddenSecrets.java index 71067b3..2d9c778 100644 --- a/src/HiddenSecrets.java +++ b/src/HiddenSecrets.java @@ -9,6 +9,9 @@ import java.io.IOException; // PUT YOUR IMPORTS HERE +import java.nio.file.Paths; +import java.util.Scanner; +import java.nio.file.Path; public class HiddenSecrets { public static void getHiddenSecrets(File file) { @@ -38,9 +41,15 @@ public static void getHiddenSecrets(File file) { public static void main(String[] args) { // Put your code to request a file path, + Scanner filePath = new Scanner(System.in); + System.out.println("Input file path"); // read in a string from System.in, + String string = filePath.nextLine(); // convert that string into A Path type using Paths class, + Path path = Path.of(string); // and call the getHiddenSecrets method to get the file's meta-data + getHiddenSecrets(path.toFile()); // HERE + System.out.println(); } }