Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @author Ranajoy
- */
- import java.util.Scanner;
- public class ClientBrowser {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.print("Enter the name of your file: ");
- String filename = sc.nextLine();
- System.out.print("Enter the file type: ");
- String filetype = sc.nextLine();
- FileHandler correctFileHandler = FileHandlerFactory.getHandler(filetype);
- if(correctFileHandler != null){
- correctFileHandler.open(filename);
- }
- else{
- System.out.println("The appropriate application for opening " + filetype + " files not found!");
- }
- }
- }
Add Comment
Please, Sign In to add comment