public static List<String> listByPrefix(String directory, String prefix, String suffix) {
		List<String> ret = new ArrayList<>();

		File d = new File(directory);

		if( !d.isDirectory() ) {
			try {
				URL url = new URL(directory);
				if( url.getProtocol().equals("file")) {
					d = new File(url.getFile());
				} else if( url.getProtocol().equals("jar")){
					return listJarPrefix(url,prefix,suffix);
				}
			} catch( MalformedURLException ignore){}
		}
		if( !d.isDirectory() )
			throw new IllegalArgumentException("Must specify an directory. "+directory);

		File files[] = d.listFiles();

		for( File f : files ) {
			if( f.isDirectory() || f.isHidden() )
				continue;

			if( prefix == null || f.getName().startsWith(prefix )) {
				if( suffix ==null || f.getName().endsWith(suffix)) {
					ret.add(f.getAbsolutePath());
				}
			}
		}

		return ret;
	}
public static List < String > listByPrefix ( String directory , String prefix , String suffix ) { List < String > ret = new ArrayList < > ( ) ; File d = new File ( directory ) ; if ( ! d . isDirectory ( ) ) { try { URL url = new URL ( directory ) ; if ( url . getProtocol ( ) . equals ( "file" ) ) { d = new File ( url . getFile ( ) ) ; } else if ( url . getProtocol ( ) . equals ( "jar" ) ) { return listJarPrefix ( url , prefix , suffix ) ; } } catch ( MalformedURLException ignore ) { } } if ( ! d . isDirectory ( ) ) throw new IllegalArgumentException ( "Must specify an directory. " + directory ) ; File files [ ] = d . listFiles ( ) ; for ( File f : files ) { if ( f . isDirectory ( ) || f . isHidden ( ) ) continue ; if ( prefix == null || f . getName ( ) . startsWith ( prefix ) ) { if ( suffix == null || f . getName ( ) . endsWith ( suffix ) ) { ret . add ( f . getAbsolutePath ( ) ) ; } } } return ret ; }
Loads a list of files with the specified prefix.

@param directory Directory it looks inside of
@param prefix Prefix that the file must have
@param suffix
@return List of files that are in the directory and match the prefix.