public int getScriptCount ( File dir ) { int scripts = 0 ; for ( ScriptType type : this . getScriptTypes ( ) ) { File locDir = new File ( dir , type . getName ( ) ) ; if ( locDir . exists ( ) ) { for ( File f : locDir . listFiles ( ) ) { String ext = f . getName ( ) . substring ( f . getName ( ) . lastIndexOf ( "." ) + 1 ) ; String engineName = this . getEngineNameForExtension ( ext ) ; if ( engineName != null ) { scripts ++ ; } } } } return scripts ; }
Gets the numbers of scripts for the given directory for the currently registered script engines and types .