From 2957d51968c25f1d00ea93d68f4ca13fca374043 Mon Sep 17 00:00:00 2001 From: CMENG92 Date: Thu, 19 Oct 2023 11:58:47 -0700 Subject: [PATCH] Assignment 003 completed! Successfully outputted all meta data. --- .idea/misc.xml | 2 +- src/HiddenSecrets.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index cf9abe6..4458232 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..f05e7f2 100644 --- a/src/HiddenSecrets.java +++ b/src/HiddenSecrets.java @@ -1,3 +1,11 @@ +/** + * + * @author Trevor Hartman + * @author Cameron Meng + * + * @since Version 1.0 + * + */ import com.drew.imaging.ImageProcessingException; import com.drew.metadata.Metadata; import com.drew.metadata.Directory; @@ -7,6 +15,9 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; +import java.nio.file.Paths; +import java.util.Scanner; +import java.nio.file.Path; // PUT YOUR IMPORTS HERE @@ -39,8 +50,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 = (Path)Paths.get(fpStr); // and call the getHiddenSecrets method to get the file's meta-data + getHiddenSecrets(path.toFile()); // HERE } }