public void checkServices ( String update ) { TreeSet < String > props = new TreeSet <> ( ) ; Enumeration < URL > us ; try { us = getClass ( ) . getClassLoader ( ) . getResources ( ELKIServiceLoader . RESOURCE_PREFIX ) ; } catch ( IOException e ) { throw new AbortException ( "Error enumerating service folders." , e ) ; } while ( us . hasMoreElements ( ) ) { URL u = us . nextElement ( ) ; try { if ( ( "jar" . equals ( u . getProtocol ( ) ) ) ) { JarURLConnection con = ( JarURLConnection ) u . openConnection ( ) ; try ( JarFile jar = con . getJarFile ( ) ) { Enumeration < JarEntry > entries = jar . entries ( ) ; while ( entries . hasMoreElements ( ) ) { String prop = entries . nextElement ( ) . getName ( ) ; if ( prop . startsWith ( ELKIServiceLoader . RESOURCE_PREFIX ) ) { props . add ( prop . substring ( ELKIServiceLoader . RESOURCE_PREFIX . length ( ) ) ) ; } else if ( prop . startsWith ( ELKIServiceLoader . FILENAME_PREFIX ) ) { props . add ( prop . substring ( ELKIServiceLoader . FILENAME_PREFIX . length ( ) ) ) ; } } } continue ; } if ( "file" . equals ( u . getProtocol ( ) ) ) { props . addAll ( Arrays . asList ( new File ( u . toURI ( ) ) . list ( ) ) ) ; } } catch ( IOException | URISyntaxException e ) { throw new AbortException ( "Error enumerating service folders." , e ) ; } } for ( String prop : props ) { if ( LOG . isVerbose ( ) ) { LOG . verbose ( "Checking property: " + prop ) ; } checkService ( prop , update ) ; } }
Retrieve all properties and check them .