/** * tries to determine the saver to use for this kind of extension, returns * null if none can be found. * * @param extension the file extension to return a converter for * @return the converter if one was found, null otherwise */ public static AbstractFileSaver getSaverForExtension(String extension) { return (AbstractFileSaver) getConverterForExtension(extension, m_FileSavers); }
/** * tries to determine the loader to use for this kind of extension, returns * null if none can be found. * * @param extension the file extension to return a converter for * @return the converter if one was found, null otherwise */ public static AbstractFileLoader getLoaderForExtension(String extension) { return (AbstractFileLoader) getConverterForExtension(extension, m_FileLoaders); }
/** * tries to determine the saver to use for this kind of extension, returns * null if none can be found. * * @param extension the file extension to return a converter for * @return the converter if one was found, null otherwise */ public static AbstractFileSaver getSaverForExtension(String extension) { return (AbstractFileSaver) getConverterForExtension(extension, m_FileSavers); }
/** * tries to determine the URL loader to use for this kind of extension, * returns null if none can be found. * * @param extension the file extension to return a URL converter for * @return the converter if one was found, null otherwise */ public static AbstractFileLoader getURLLoaderForExtension(String extension) { return (AbstractFileLoader) getConverterForExtension(extension, m_URLFileLoaders); }
/** * tries to determine the URL loader to use for this kind of extension, * returns null if none can be found. * * @param extension the file extension to return a URL converter for * @return the converter if one was found, null otherwise */ public static AbstractFileLoader getURLLoaderForExtension(String extension) { return (AbstractFileLoader) getConverterForExtension(extension, m_URLFileLoaders); }
/** * tries to determine the loader to use for this kind of extension, returns * null if none can be found. * * @param extension the file extension to return a converter for * @return the converter if one was found, null otherwise */ public static AbstractFileLoader getLoaderForExtension(String extension) { return (AbstractFileLoader) getConverterForExtension(extension, m_FileLoaders); }
/** * tries to determine the converter to use for this kind of file, returns null * if none can be found in the given hashtable. * * @param filename the file to return a converter for * @param ht the hashtable with the relation extension/converter * @return the converter if one was found, null otherwise */ protected static Object getConverterForFile(String filename, Hashtable<String, String> ht) { Object result; String extension; int index; result = null; index = filename.lastIndexOf('.'); if (index > -1) { extension = filename.substring(index).toLowerCase(); result = getConverterForExtension(extension, ht); // is it a compressed format? if (extension.equals(".gz") && result == null) { index = filename.lastIndexOf('.', index - 1); extension = filename.substring(index).toLowerCase(); result = getConverterForExtension(extension, ht); } } return result; }
/** * tries to determine the converter to use for this kind of file, returns null * if none can be found in the given hashtable. * * @param filename the file to return a converter for * @param ht the hashtable with the relation extension/converter * @return the converter if one was found, null otherwise */ protected static Object getConverterForFile(String filename, Hashtable<String, String> ht) { Object result; String extension; int index; result = null; index = filename.lastIndexOf('.'); if (index > -1) { extension = filename.substring(index).toLowerCase(); result = getConverterForExtension(extension, ht); // is it a compressed format? if (extension.equals(".gz") && result == null) { index = filename.lastIndexOf('.', index - 1); extension = filename.substring(index).toLowerCase(); result = getConverterForExtension(extension, ht); } } return result; }