AnalyzerGuru.java revision 99
0N/A * The contents of this file are subject to the terms of the 0N/A * Common Development and Distribution License (the "License"). 0N/A * You may not use this file except in compliance with the License. 0N/A * language governing permissions and limitations under the License. 0N/A * When distributing Covered Code, include this CDDL HEADER in each 0N/A * If applicable, add the following below this CDDL HEADER, with the 0N/A * fields enclosed by brackets "[]" replaced with your own identifying 0N/A * information: Portions Copyright [yyyy] [name of copyright owner] 143N/A * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 0N/A * Use is subject to license terms. 202N/A * Manages and porvides Analyzers as needed. 202N/A * Created on September 22, 2005 202N/A * If you write your own analyzer please register it here 202N/A * Initializes an AnalyzerGuru 202N/A // TODO: have a comparator 36N/A //System.err.println(analyzer.getSimpleName() + " = " + suffix); 202N/A // System.err.println("AnalyzerFinder:" + analyzer.getSimpleName() + e); 202N/A //System.err.println(analyzer.getSimpleName() + " = " + magic); 202N/A // System.err.println("AnalyzerFinder: " + analyzer.getSimpleName() + e); 202N/A //System.err.println("Exts " + ext); 202N/A //System.err.println("Matchers " + matchers); 126N/A * Get the default Analyzer. 143N/A * use this if you want to analyze a file. Analyzers are costly. 202N/A // date = hr.getLastCommentDate() //RFE 143N/A // Ignoring any errors while analysing 0N/A * @return The contentType suitable for printing to response.setContentType() 202N/A * @return The genre suitable to decide how to display the file 202N/A * Finds a suitable analyser class for an InputStream and a file name 143N/A * Use if you just want to find file type. 210N/A //System.err.println(path.substring(dotpos+1).toUpperCase() + " = " + analyzer.getSimpleName()); 210N/A //System.out.println("USING = " + matcher.getName()); 210N/A // cannot check conversion because of reflection