Get all file names in a given app's directory
@param appName
@param dir
@returns {*}
433400
function getAppFileNames(appName, dir) {
    var partialsDir = this.pancakes.getRootDir() + delim + 'app' + delim + appName + delim + dir;
    return fs.existsSync(partialsDir) ? fs.readdirSync(partialsDir) : [];
}
145752
function paths(dir) {
	var paths = [];

	try {
		fs.statSync(dir);
	}
	catch (e) {
		return e;
	}

	(function traverse(dir, stack) {
		stack.push(dir);
		fs.readdirSync(stack.join('/')).forEach(function(file) {
			var path = stack.concat([file]).join('/'),
				stat = fs.statSync(path);

			if (file[0] == '.' || file === 'vendor') {
				return;
			} else if (stat.isFile() && /\.js$/.test(file)) {
				paths.push(path);
			} else if (stat.isDirectory()) {
				paths.push(path);
				traverse(file, stack);
			}
		});
		stack.pop();
	})(dir || '.', []);

	return paths;
}
1654
public static final List<String> listProjectNames(File directory)
   {
      List<String> result = new ArrayList<String>();

      File[] files = directory.listFiles(new FilenameFilter()
      {
         @Override public boolean accept(File dir, String name)
         {
            return name.toUpperCase().endsWith("STR.P3");
         }
      });

      if (files != null)
      {
         for (File file : files)
         {
            String fileName = file.getName();
            String prefix = fileName.substring(0, fileName.length() - 6);
            result.add(prefix);
         }
      }

      Collections.sort(result);

      return result;
   }
1364176
function guessAppName (compilerWorkingDirectory) {
  var packageJson = path.resolve(compilerWorkingDirectory, 'package.json');
  if (!fs.existsSync(packageJson)) {
    packageJson = path.resolve(compilerWorkingDirectory, '../package.json');
    if (!fs.existsSync(packageJson)) {
      return 'Webpack App';
    }
  }
  return JSON.parse(fs.readFileSync(packageJson)).name;
}
1078817
function readDirSync (dir, allFiles = []) {
  const files = fs.readdirSync(dir).map(f => join(dir, f))
  allFiles.push(...files)
  files.forEach(f => {
    fs.statSync(f).isDirectory() && readDirSync(f, allFiles)
  })
  return allFiles
}
740282
function getPackCardFiles(dir) {
  var cards = [],
    files = FS.readdirSync(dir);

  for (var i = 0; i < files.length; i++) {
    var fileName = files[i];

    if (Path.extname(fileName) === '.js') {
      cards.push(Path.basename(fileName, Path.extname(fileName)));
    }
  }

  return cards;
}
374453
protected static String getFileName(Appender app) {

        String result = null;
        Method getFileName;
        try {
            getFileName = app.getClass().getDeclaredMethod("getFileName", (Class<?>[])null);

            result = (String)getFileName.invoke(app, (Object[])null);
        } catch (Exception e) {
            LOG.warn(e.getLocalizedMessage(), e);
        }
        return result;
    }
53473
def listdir(directory):
    
    file_names = list()
    for filename in os.listdir(directory):
        file_path = os.path.join(directory, filename)
        if os.path.isdir(file_path):
            filename = f'{filename}{os.path.sep}'
        file_names.append(filename)
    return file_names
528403
function list(appName, callback) {
    commons.get(format('/%s/apps/%s/perms/', deis.version, appName), callback);
  }
475939
private static File[] getAllFiles(String dirName) {

    File dir = new File(dirName);

    File[] files = dir.listFiles(); // returns files and folders

    if (files != null) {
      List<File> filteredFiles = new ArrayList<File>();
      for (File file : files) {

        if (file.isFile()) {
          filteredFiles.add(file);
        }
      }
      return filteredFiles.toArray(new File[filteredFiles.size()]);
    } else {
      System.out.println(dirName + " does not denote a valid directory!");
      return new File[0];
    }
  }
176518
function list(appName, callback) {
    var uri = format('/%s/apps/%s/config/', deis.version, appName);
    commons.get(uri, function onListResponse(err, result) {
      callback(err, result ? result.values : null);
    });
  }
1094102
def list_folder(self, dir_name=None, prefix=None, num=1000, context=None):
        
        if dir_name[0] == '/':
            dir_name = dir_name[1:len(dir_name)]
        self.url = 'http://<Region>.file.myqcloud.com/files/v2/<appid>/<bucket_name>/'
        self.url = self.url.replace("<Region>", self.config.region).replace("<appid>", str(self.config.app_id)).replace("<bucket_name>", self.config.bucket)
        if dir_name is not None:
            self.url = self.url + str(dir_name) + "/"
        if prefix is not None:
            self.url = self.url + str(prefix)
        self.url = self.url + "?op=list&num=" + str(num)
        if context is not None:
            self.url = self.url + '&context=' + str(context)
        self.headers['Authorization'] = CosAuth(self.config).sign_more(self.config.bucket, '', 30)
        response, content = self.http.request(uri=self.url, method='GET', headers=self.headers)
        return content.decode("utf8")
333448
function(dir) {
  var methods = [];

  var findConfigFiles = function(dir) {
    fs.readdirSync(dir).forEach(function(file) {
      file = path.join(dir, file);
      var stat = fs.statSync(file);
      if(stat && stat.isDirectory()) {
        findConfigFiles(file);
      } else if(/config.js$/.test(file)) {
        methods.push(file);
      }
    });
  };

  findConfigFiles(dir);

  return methods;
}
1035090
function getSourceDirectories() {
	var dirs = [ 'lib', 'src', 'app' ],
		result = [];

	dirs.forEach(function(dir) {
		if (test('-d', dir)) {
			result.push(dir);
		}
	});

	return result;
}
847198
public static final File[] findJarFileByDir(File dir)
	{
		if(dir==null)
		{
			throw new NullArgumentException("dir ==null");
		}
		if(dir.isFile())
		{
			throw new IllegalArgumentException("dir "+dir+" is not a dir");
		}
		if(!dir.exists())
		{
			throw new IllegalArgumentException("dir "+dir+" not found");
		}
		File[] jarFiles = dir.listFiles(new FileFilter() {
			@Override
			public boolean accept(File pathname) 
				{
					return pathname.getName().endsWith(".jar");
				}
			});
		return jarFiles;
	}
784850
function getEntries(dirName) {
  const entries = {};
  getExamples(dirName, (entryName, filename) => {
    entries[entryName] = filename;
  });
  return entries;
}
276520
function getFiles(folder = srcFolder){
  let all = [];
  let f = fs.readdirSync(folder);
  for(file of f){
    all.push(path.join(folder,file))
    if(fs.lstatSync(path.join(folder,file)).isDirectory()){
      all = all.concat(getFiles(path.join(folder,file)));
    }
  }
  return all;
}