java mengambil nama file dalam folder

Bagaimana cara mengambil nama file dalam suatu folder

Bismillah

q> Langsung Aja (LA)


package com.saifiahmada.mysqllog;

import java.io.File;

/** @author Saifi Ahmada Sep 24, 2014 10:20:54 AM **/

public class MysqlLog {

public static void main (String [] args) {

File folder = new File("/home/saifi/Program/MYSQL_LOG/");

File [] files = folder.listFiles();

for (File file : files) {
System.out.println("Nama File : " + file.getName());
}

}

}

Selection_438

q> Output
Selection_439

Published by

saifiahmada

Begin a big Process with a bit trying

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s