Demonstration

mail@pastecode.io avatar
unknown
java
2 years ago
558 B
1
Indexable
Never
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" ); 
			}
		}
	}
}