Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,24 @@ 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**?
- The access modifer was a public.

* Is it a **Class method** or an **object Instance method**, how do you know?
- It is a class method becuase it was a class file.

* What is its **return data-type**?
- There is no return data type the function is a void

* Does it require any **arguments** to call it, and if so, how many **parameters** and of what **data-type**?
- It does require one argument which is called File and the data type is a file

* Scan line by line through the code and try to determine how it works?
* What is familiar to you?
- The stuff that is familiar to me is the System.out.println(); function which just prints out the data for you but the rest I am not really understanding it
* What is not familiar to you?
- How it is printing out all the data.
* Do the **for** loops make sense, and if so, tell me what you think they do?
- I think that the for loops is grabbing the data from the directories

## PART 4 - Turn in

Expand Down
Binary file added images/Capture.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/HiddenSecrets.java
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 stStr = s.nextLine();
// convert that string into A Path type using Paths class,
Path path = Paths.get(stStr);
// and call the getHiddenSecrets method to get the file's meta-data
getHiddenSecrets(path.toFile());
// HERE
}
}