Here you can find the source of setExecutable(File f, final String pattern)
public static void setExecutable(File f, final String pattern)
//package com.java2s; //it under the terms of the GNU Affero General Public License as published by import java.io.File; import java.io.FilenameFilter; import java.util.regex.Pattern; public class Main { public static void setExecutable(File f, final String pattern) { if (f.isDirectory()) { File[] files = f.listFiles(new FilenameFilter() { @Override/*from ww w. j a v a2 s . c o m*/ public boolean accept(File dir, String name) { return Pattern.matches(pattern, name); } }); for (File bin : files) { bin.setExecutable(true); } } else { f.setExecutable(true); } } }