Demonstration

 avatar
unknown
java
3 years ago
558 B
4
Indexable
import java.io.File;

public class Demonstration
{
	public void analyze_path(String path)
	{
		File file_name = new File(path);
		if (file_name.exists())
		{
			System.out.printf("%s", file_name.getName()+" tersedia");
			
			if	(file_name.isDirectory())
			{
				String directory[] = file_name.list();
				System.out.println("Isi Folder: ");
				for(String folder_name : directory)
				{
					System.out.printf("%s\n", folder_name);
			
				}
			}
			else
			{
				System.out.printf( "%s", path, "tidak tersedia" ); 
			}
		}
	}
}
Editor is loading...