forked from CRen88888/FileWriterActivity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecretWriter.java
More file actions
31 lines (23 loc) · 873 Bytes
/
SecretWriter.java
File metadata and controls
31 lines (23 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class SecretWriter {
public static void createHiddenFile(){
try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(".hiddenfile.txt"))) {
bufferedWriter.write("password");
} catch (IOException e) {
e.printStackTrace();
}
}
public static void regularFile(){
try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(".secretfolder/passwordfile.txt"))) {
bufferedWriter.write("passwordisunique");
} catch (IOException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
createHiddenFile();
regularFile();
}
}