private String getFile(final String dirname, final String start, final boolean exactMatch) {
        String[] array = directories.get(dirname);
        if (array == null) {
            array = new File(dirname).list();
            directories.put(dirname, array);
        }
        
        final int length = start.length();
        
        for (String name : array) {
            if (name.substring(0, length).equalsIgnoreCase(start) && //!name.contains("~") &&
                    (!exactMatch || !Character.isLetterOrDigit(name.charAt(length)))) {
                return new File(dirname + File.separatorChar + name).getAbsolutePath();
            }
        }
        return null;
    }