src/main/java/de/vandermeer/execs/cf/CF_Locator.java
protected final void include(String name, File file){
		if(!file.exists()){
			return;
		}
		if(!file.isDirectory()){
			if(this.jarFilter.size()>0){
				boolean ok = false;
				for(String s : this.jarFilter){
					if(file.getName().startsWith(s)){
						ok = true;
					}
				}
				if(ok==false){
					return;
				}
			}
			this.includeJar(file);
			return;
		}

		if(name==null){
			name = "";
		}
		else{
			name += ".";
		}

		File[] dirs = file.listFiles(CF_Utils.DIRECTORIES_ONLY);
		for(int i=0; i<dirs.length; i++){
			try{
				this.locationMap.put(new URI("file://" + dirs[i].getCanonicalPath()), name + dirs[i].getName());
			}
			catch(IOException ignore){return;}
			catch(URISyntaxException ignore){return;}

			this.include(name + dirs[i].getName(), dirs[i]);
		}
	}
protected final void include(String name, File file){
		if(!file.exists()){
			return;
		}
		if(!file.isDirectory()){
			if(this.jarFilter.size()>0){
				boolean ok = false;
				for(String s : this.jarFilter){
					if(file.getName().startsWith(s)){
						ok = true;
					}
				}
				if(ok==false){
					return;
				}
			}
			this.includeJar(file);
			return;
		}

		if(name==null){
			name = "";
		}
		else{
			name += ".";
		}

		File[] dirs = file.listFiles(CF_Utils.DIRECTORIES_ONLY);
		for(int i=0; i<dirs.length; i++){
			try{
				this.locationMap.put(new URI("file://" + dirs[i].getCanonicalPath()), name + dirs[i].getName());
			}
			catch(IOException ignore){return;}
			catch(URISyntaxException ignore){return;}

			this.include(name + dirs[i].getName(), dirs[i]);
		}
	}
protected final void include ( String name , File file ) { if ( ! file . exists ( ) ) { return ; } if ( ! file . isDirectory ( ) ) { if ( this . jarFilter . size ( ) > 0 ) { boolean ok = false ; for ( String s : this . jarFilter ) { if ( file . getName ( ) . startsWith ( s ) ) { ok = true ; } } if ( ok == false ) { return ; } } this . includeJar ( file ) ; return ; } if ( name == null ) { name = "" ; } else { name += "." ; } File [ ] dirs = file . listFiles ( CF_Utils . DIRECTORIES_ONLY ) ; for ( int i = 0 ; i < dirs . length ; i ++ ) { try { this . locationMap . put ( new URI ( "file://" + dirs [ i ] . getCanonicalPath ( ) ) , name + dirs [ i ] . getName ( ) ) ; } catch ( IOException ignore ) { return ; } catch ( URISyntaxException ignore ) { return ; } this . include ( name + dirs [ i ] . getName ( ) , dirs [ i ] ) ; } }
Include a name and file
@param name name to be included, if null will be set to empty
@param file file to be included
Include a name and file