public File getJar(File folder, String regExp){  File jarFile=null; boolean found=false; int index=0;  File allFiles[]= folder.listFiles(); if(allFiles==null){ logger.error("No files found in "+folder.getAbsolutePath()); allFiles = new File[0]; }  Pattern p = Pattern.compile(regExp); while(!found && index<allFiles.length){ Matcher m = p.matcher(allFiles[index].getName()); if( m.matches() ){ jarFile=allFiles[index]; found=true; } index++; }  return jarFile;
public File getJar(File folder, String jarFileBaseName){ String fileToFind = folder.getAbsolutePath() + File.separatorChar + jarFileBaseName + ".jar"; String resolvedFile = jarFileResolver.getResolvedFileName( fileToFind ); File jar = new File(resolvedFile); if (jar.exists()) { logger.debug( "Found match: " + resolvedFile + " for file pattern: " + fileToFind ); return jar; } else { logger.warn("Could not resolve file pattern: " + fileToFind); return null; }
    public File getJar(File folder, String regExp){              File jarFile=null;        boolean found=false;        int index=0;                File allFiles[]= folder.listFiles();        if(allFiles==null){            logger.error("No files found in "+folder.getAbsolutePath());            allFiles = new File[0];        }                Pattern p = Pattern.compile(regExp);        while(!found && index<allFiles.length){            Matcher m = p.matcher(allFiles[index].getName());            if( m.matches() ){                jarFile=allFiles[index];                found=true;            }            index++;        }                return jarFile;    }