Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @author Ranajoy
- */
- public class FileHandlerFactory {
- // Return the correct FileHandler according to type
- static FileHandler getHandler(String type){
- FileHandler myFileHandler = null;
- if("pdf".equalsIgnoreCase(type)){
- myFileHandler = new PDFHandler();
- }
- else if("html".equalsIgnoreCase(type)){
- myFileHandler = new HTMLHandler();
- }
- else if("doc".equalsIgnoreCase(type)){
- myFileHandler = new WordDocumentHandler();
- }
- return myFileHandler;
- }
- }
Add Comment
Please, Sign In to add comment