String isVoice = attributes.getValue("FreeTTSVoiceDefinition");  if (isVoice != null && isVoice.trim().equals("true")) { voiceJarURLs.add(jarURL);
if (attributes != null) { String isVoice = attributes.getValue("FreeTTSVoiceDefinition"); if (isVoice != null && isVoice.trim().equals("true")) { voiceJarURLs.add(jarURL); }
    private UniqueVector getVoiceJarURLsFromDir(String dirName)            throws FileNotFoundException {        try {            UniqueVector voiceJarURLs = new UniqueVector();            File dir = new File(new URI("file://" + dirName));            if (!dir.isDirectory()) {                throw new FileNotFoundException("File is not a directory: "                        + dirName);            }            File[] files = dir.listFiles();            for (int i = 0; i < files.length; i++) {                //System.out.println("TEST: checking url " + files[i].getName());                if (files[i].isFile() && (!files[i].isHidden()) &&                        files[i].getName().endsWith(".jar")) {                    URL jarURL = files[i].toURL();                    jarURL = new URL("jar", "",                            "file:"+ jarURL.getPath() + "!/");                    //System.out.println("TEST: reading url " + jarURL);                    JarURLConnection jarConnection = (JarURLConnection)                        jarURL.openConnection();                    Attributes attributes = jarConnection.getMainAttributes();                    String isVoice =                        attributes.getValue("FreeTTSVoiceDefinition");                    if (isVoice != null && isVoice.trim().equals("true")) {                        voiceJarURLs.add(jarURL);                    }                }            }            return voiceJarURLs;        } catch (java.net.URISyntaxException e) {            throw new Error("Error reading directory name '" + dirName + "'.");        } catch (MalformedURLException e) {            throw new Error("Error reading jars from directory "                    + dirName + ". ");        } catch (IOException e) {            throw new Error("Error reading jars from directory "                    + dirName + ". ");        }    }