String home = System.getProperty("exist.home"); if (home != null) { File f = new File(home + File.separator + MIME_TYPES_XML); if (f.canRead()) { try { System.out.println("Loading mime table from file " + f.getAbsolutePath()); loadMimeTypes(new FileInputStream(f)); loaded = true; this.src=f.toURI().toString(); } catch (FileNotFoundException e) { System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath()); } catch (ParserConfigurationException e) { System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath()); } catch (SAXException e) { System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath()); } catch (IOException e) { System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath()); }
File f = Configuration.lookup(MIME_TYPES_XML); if (f.canRead()) { try { System.out.println("Loading mime table from file " + f.getAbsolutePath()); loadMimeTypes(new FileInputStream(f)); loaded = true; this.src=f.toURI().toString(); } catch (FileNotFoundException e) { System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath()); } catch (ParserConfigurationException e) { System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath()); } catch (SAXException e) { System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath()); } catch (IOException e) { System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath());
    private void load() {        boolean loaded = false;        String home = System.getProperty("exist.home");        if (home != null) {            File f = new File(home + File.separator + MIME_TYPES_XML);            if (f.canRead()) {                try {                    System.out.println("Loading mime table from file " + f.getAbsolutePath());                    loadMimeTypes(new FileInputStream(f));                    loaded = true;                    this.src=f.toURI().toString();                } catch (FileNotFoundException e) {                    System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath());                } catch (ParserConfigurationException e) {                    System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath());                } catch (SAXException e) {                    System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath());                } catch (IOException e) {                    System.err.println(FILE_LOAD_FAILED_ERR + f.getAbsolutePath());                }            }        }        if (!loaded) {            ClassLoader cl = MimeTable.class.getClassLoader();            InputStream is = cl.getResourceAsStream(MIME_TYPES_XML_DEFAULT);            if (is == null) {                System.err.println(LOAD_FAILED_ERR);            }            try {                loadMimeTypes(is);                this.src="resource://"+MIME_TYPES_XML_DEFAULT;            } catch (ParserConfigurationException e) {                System.err.println(LOAD_FAILED_ERR);            } catch (SAXException e) {                System.err.println(LOAD_FAILED_ERR);            } catch (IOException e) {                System.err.println(LOAD_FAILED_ERR);            }        }    }