Skip to content
Open
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
14 changes: 11 additions & 3 deletions MyFileWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@

public class MyFileWriter {

public static void CreateDir(String name) { // heyyyy bro i slid this in just for u
if (new File(name).exists()) {
return;
} else {
File newDir = new File(name);
newDir.mkdir();
}
}

public static void createHiddenFile() {
try {
File hiddenFile = new File("aboutSydney.txt");

if (!hiddenFile.exists()) {
BufferedWriter writer = new BufferedWriter(new FileWriter(hiddenFile));

writer.write("Haha Nathan I don't care about your fun facts");
writer.close();
System.out.println("Hidden file created with password.");
}
else {
} else {
System.out.println("The hidden file already exists.");
}
} catch (IOException e) {
Expand Down