diff --git a/.idea/Java-Assignment-003.iml b/.idea/Java-Assignment-003.iml index 2e64cec..0f3cd21 100644 --- a/.idea/Java-Assignment-003.iml +++ b/.idea/Java-Assignment-003.iml @@ -16,5 +16,14 @@ + + + + + + + + + \ No newline at end of file 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..9ea6607 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,32 @@ 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)? - * Is it a **Class method** or an **object Instance method**, how do you know? - * What is its **return data-type**? - * Does it require any **arguments** to call it, and if so, how many **parameters** and of what **data-type**? + + * Private + + * Is it a **Class method** or an **object Instance method**, how do you know? + + * It is an Object Instance method, not to sure really + + * What is its **return data-type**? + + * It is an Object + + * Does it require any **arguments** to call it, and if so, how many **parameters** and of what **data-type**? + + * It requires one parameter,I think. + * Scan line by line through the code and try to determine how it works? * What is familiar to you? + * I am familiar with the scanner, strings, println, main line, and creating an object, but that's sort of it * What is not familiar to you? + + * The catch which I could assume what it does, the try and also the for. + * Do the **for** loops make sense, and if so, tell me what you think they do? + * They don't make sense to me. + +Also in the first instructions you tell us to add the metadata-extractor, but it is already here in this document, I went ahead and added it again just to show I know how to do it in case that was what you were looking for. ## PART 4 - Turn in diff --git a/images/Screenshot 2023-09-12 114447.png b/images/Screenshot 2023-09-12 114447.png new file mode 100644 index 0000000..05186da Binary files /dev/null and b/images/Screenshot 2023-09-12 114447.png differ diff --git a/src/HiddenSecrets.java b/src/HiddenSecrets.java index 71067b3..420567a 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,8 +42,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 s = new Scanner(System.in); + System.out.println("Give me a file: "); + String fpstr = s.nextLine(); // convert that string into A Path type using Paths class, + Path path = Paths.get(fpstr); // and call the getHiddenSecrets method to get the file's meta-data + getHiddenSecrets(path.toFile()); // HERE } }