Here you can find the source of ensureFileIsExecutable(String filename)
Parameter | Description |
---|---|
filename | a parameter |
public static boolean ensureFileIsExecutable(String filename)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { /**/*from ww w .ja va 2 s .c o m*/ * Ensure that given file, if it exists, is executable * * @param filename */ public static boolean ensureFileIsExecutable(String filename) { File file = new File(filename); if (file.exists()) { if (file.canExecute()) { return true; } return file.setExecutable(true); } return false; } }