Skip to content

Instantly share code, notes, and snippets.

Created September 6, 2014 07:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Aplikasi File Finder
import java.util.*;
class SearchFileApp {
public void findFile(String name, File file) {
File[] list = file.listFiles();
if (list != null)
for (File fil : list) {
if (fil.isDirectory()) {
findFile(name, fil);
} else if (name.equalsIgnoreCase(fil.getName())) {
public static void main(String[] ar) {
SearchFileApp sf = new SearchFileApp();
System.out.println("============= >File Finder App< =============");
Scanner scan = new Scanner(;
System.out.println("Masukkan nama file yang ingin dicari.. ");
String name =;
System.out.println("Masukkan lokasi pencarian.. (/home/) ");
String directory =;
System.out.println(">Process Pencarian<");
sf.findFile(name, new File(directory));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment