@Test public void testSetScriptsExecutableOnDirectory() throws Exception { File dir = this.folder.newFolder(); File f = new File( dir, "whatever" ); Assert.assertTrue( f.createNewFile()); Assert.assertFalse( f.canExecute()); ScriptUtils.setScriptsExecutable( dir ); Assert.assertTrue( f.canExecute()); }
public static void setScriptsExecutable( File fileOrDir ) { List<File> files = new ArrayList<> (); if( fileOrDir.isDirectory()) files.addAll( Utils.listAllFiles( fileOrDir, true )); else files.add( fileOrDir ); for( File f : files ) f.setExecutable( true ); }
ScriptUtils { public static void setScriptsExecutable( File fileOrDir ) { List<File> files = new ArrayList<> (); if( fileOrDir.isDirectory()) files.addAll( Utils.listAllFiles( fileOrDir, true )); else files.add( fileOrDir ); for( File f : files ) f.setExecutable( true ); } }
ScriptUtils { public static void setScriptsExecutable( File fileOrDir ) { List<File> files = new ArrayList<> (); if( fileOrDir.isDirectory()) files.addAll( Utils.listAllFiles( fileOrDir, true )); else files.add( fileOrDir ); for( File f : files ) f.setExecutable( true ); } private  ScriptUtils(); }
ScriptUtils { public static void setScriptsExecutable( File fileOrDir ) { List<File> files = new ArrayList<> (); if( fileOrDir.isDirectory()) files.addAll( Utils.listAllFiles( fileOrDir, true )); else files.add( fileOrDir ); for( File f : files ) f.setExecutable( true ); } private  ScriptUtils(); static Map<String,String> formatExportedVars( Instance instance ); static Map<String,String> formatImportedVars( Instance instance ); static void setScriptsExecutable( File fileOrDir ); }
ScriptUtils { public static void setScriptsExecutable( File fileOrDir ) { List<File> files = new ArrayList<> (); if( fileOrDir.isDirectory()) files.addAll( Utils.listAllFiles( fileOrDir, true )); else files.add( fileOrDir ); for( File f : files ) f.setExecutable( true ); } private  ScriptUtils(); static Map<String,String> formatExportedVars( Instance instance ); static Map<String,String> formatImportedVars( Instance instance ); static void setScriptsExecutable( File fileOrDir );  }