Java File Attribute setExecutable(File f, final String pattern)

Here you can find the source of setExecutable(File f, final String pattern)

Description

set Executable

License

Open Source License

Declaration

public static void setExecutable(File f, final String pattern) 

Method Source Code

//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);
        }
    }
}

Related

  1. makeExecutable(File target)
  2. makeExecutable(String path)
  3. parallel(ExecutorService executor, Collection> tasks)
  4. patchInfoPList(final File infoPList, final String executable)
  5. persistExecutionTimesCsv(String filePath, LinkedList> executionTimes)
  6. setExecutable(File file)
  7. setExecutable(File file, boolean executable)
  8. setExecutable(String filesList)
  9. setExecute(File f, boolean b)