Scan for the configuration and build list of files, but do not load the files.

This method may be called many times, but it will detect the configuration only once.
348581
public function detectConfiguration()
	{
		// Use default file readers if none provided
		if (empty($this->file_readers)) {
			$this->file_readers = [
				JsonReader::class => new JsonReader(),
				GraphMLReader::class => new GraphMLReader(),
				BpmnReader::class => new BpmnReader(),
			];
		}

		// Scan base dir for machines and find youngest file
		if ($this->file_list === null) {
			$dh = opendir($this->base_dir);
			if (!$dh) {
				throw new RuntimeException('Cannot open base dir: ' . $this->base_dir);
			}
			$this->file_list = [];
			while (($file = readdir($dh)) !== false) {
				if ($file[0] != '.') {
					$this->file_list[] = $file;
				}
			}
			closedir($dh);
		}
	}
887612
public List<File> files() throws ParseException, IOException
    {
        final List<File> files1 = files(new File(startingPath));
        logger.trace("wildfile counts: dir({}) files({}) matched({})",
                scanDirCount, scanFileCount, files1.size());
        return files1;
    }
326147
private String[] scan( FileSet fileSet )
    {
        File basedir = new File( fileSet.getDirectory() );
        if ( !basedir.exists() || !basedir.isDirectory() )
        {
            return null;
        }

        DirectoryScanner scanner = new DirectoryScanner();

        List<String> includes = fileSet.getIncludes();
        List<String> excludes = fileSet.getExcludes();

        if ( includes != null && includes.size() > 0 )
        {
            scanner.setIncludes( includes.toArray( new String[0] ) );
        }

        if ( excludes != null && excludes.size() > 0 )
        {
            scanner.setExcludes( excludes.toArray( new String[0] ) );
        }

        scanner.setBasedir( basedir );

        scanner.scan();
        return scanner.getIncludedFiles();
    }
1176679
private static void checkPaths(Configuration conf, List<Path> paths) throws
  IOException {
    for (Path p : paths) {
      FileSystem fs = p.getFileSystem(conf);
      if (!fs.exists(p)) {
        throw new FileNotFoundException("Source " + p + " does not exist.");
      }
    }
  }
1046751
public void load(FileConfiguration config) {
        this.config = config;
        
        try {
            parse();
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
    }
1146534
void showFilesConfiguration() {

        // Message to communicate the resolved configuration:
        String message;
        if (filesUrl != null) {
            String reload = filesReloadable ? "reloadable" : "non-reloadable";
            message = "Files will be served from: " + filesUrl + " (" + reload + ")";
        } else {
            message = "No static files will be served.";
        }
        log.info("Files: {}", message);
    }
591256
def not_files(self):
        """"""

        _args = []

        for arg in self.all:
            if not len(_expand_path(arg)):
                if not os.path.exists(arg):
                    _args.append(arg)

        return ArgsList(_args, no_argv=True)
1249960
private void scanFileList(List<File> lstFiles) {
        progressListener.onFileScanBegin();
        Iterator<File> itFile = lstFiles.iterator();
        while (itFile.hasNext()) {
            File currentFile = itFile.next();
            progressListener.onFileScan(currentFile);
            scanFile(currentFile);
        }
    }
841555
private boolean scanHadoopConfigFiles(final ServerInformationCatalog serverInformationCatalog,
            final String selectedServer) {

        final HadoopClusterInformation clusterInformation;
        if (selectedServer != null) {
            clusterInformation = (HadoopClusterInformation) serverInformationCatalog.getServer(selectedServer);
        } else {
            clusterInformation = (HadoopClusterInformation) serverInformationCatalog
                    .getServer(HadoopResource.DEFAULT_CLUSTERREFERENCE);
        }

        if (clusterInformation == null) {
            return false;
        }

        final Configuration configuration = HdfsUtils.getHadoopConfigurationWithTimeout(clusterInformation);

        _currentDirectory = new Path("/");

        try {
            _fileSystem = FileSystem.newInstance(configuration);
        } catch (final IOException e) {
            throw new IllegalArgumentException("Illegal URI when showing HDFS chooser", e);
        }
        final HdfsDirectoryModel model = (HdfsDirectoryModel) _fileList.getModel();
        model.updateFileList();
        return model._files.length > 0;
    }
83549
def _scan(self, trigger=True):
        
        changed = False
        files_seen = set()
        os_path_join = os.path.join
        for path in self.paths:
            for root, dirs, files in os.walk(path):
                for f in files:
                    fpath = os_path_join(root, f)
                    if not self.is_valid_type(fpath):
                        continue
                    files_seen.add(fpath)
                    if self._requires_new_modtime(fpath):
                        self._watch_file(fpath, trigger)
                        changed = True
            for f in self._watched_files:
                if f not in files_seen:
                    self._unwatch_file(f, trigger)
                    changed = True
        return changed
936787
public void init() {
        if (logger != null && StringUtils.isNotEmpty(name)) {
            if (logger.isWarnEnabled() && !ConfigUtils.isFilePath(name)) {
                try {
                    List<String> realPaths = new ArrayList<String>();
                    Enumeration<URL> e = Thread.currentThread().getContextClassLoader().getResources(name);
                    while (e.hasMoreElements()) {
                        URL url = (URL) e.nextElement();
                        realPaths.add(url.getFile());
                    }
                    if (realPaths.size() > 1) {
                        logger.warn("Multi httl config in classpath, conflict configs: " + realPaths + ". Please keep only one config.");
                    }
                } catch (IOException e) {
                    logger.error(e.getMessage(), e);
                }
            }
            if (logger.isInfoEnabled()) {
                String realPath = ConfigUtils.getRealPath(name);
                if (StringUtils.isNotEmpty(realPath)) {
                    logger.info("Load httl config from " + realPath + " in " + (name.startsWith("/") ? "filesystem" : "classpath") + ".");
                }
            }
        }
    }
387334
public void run() {
    LOGGER.debug("begin scan for config file changes ...");
    try {
      Date lastModified = new Date(_xmlConfigFile.lastModified());

      if (_lastTimeRead == null || lastModified.after(_lastTimeRead)) {
        LOGGER.info("loading config file changes ...");
        this.loadServiceConfigFile();
        _lastTimeRead = new Date();
      }
    } catch (ConfigurationException e) {
      e.printStackTrace();
      LOGGER.error( "Error loading configuation file: ", e );
    }
    LOGGER.debug("finish scan for config file changes");
  }
1072591
def load(self, patterns, dirs, ignore=None):
        
        for _dir in dirs:
            data = self.read_file(_dir, ignore=ignore)
            if data:
                self.paths[_dir] = data
708022
def _check_config_exists(config_file=None):
    '''
    
    '''
    if config_file is None:
        config_file = _config_file()
    if not os.path.isfile(config_file):
        return False
    return True
405471
def read (self, files):
        
        assert isinstance(files, list), "Invalid file list %r" % files
        try:
            self.read_ok = super(LCConfigParser, self).read(files)
            if len(self.read_ok) < len(files):
                failed_files = set(files) - set(self.read_ok)
                log.warn(LOG_CHECK, "Could not read configuration files %s.", failed_files)
            # Read all the configuration parameters from the given files.
            self.read_checking_config()
            self.read_authentication_config()
            self.read_filtering_config()
            self.read_output_config()
            self.read_plugin_config()
        except Exception as msg:
            raise LinkCheckerError(
              _("Error parsing configuration: %s") % unicode(msg))
683348
def ensure_build(self):
        
        if self.config.build_url:
            path = get_buildfile_path(self.config)

            # Ensure that builds_root has been created.
            mkdir(BUILDS_ROOT)
            build_md5 = getattr(self.config, 'build_md5', None)
            ensure_file(self.config.build_url, path, build_md5)

            # Now untar.
            self.untar()
1259631
def precheck():
    
    cfg_path = local_config['PROJECT']['CONFIG_PATH']
    # enable or disable logging based on config/ defaults
    logging = set_logging(local_config)

    if os.path.exists(cfg_path):
        logger.info('%s: config_path parameter: %s' % (inspect.stack()[0][3], cfg_path))
        logger.info(
            '%s: Existing configuration file found. precheck pass.' %
            (inspect.stack()[0][3]))
        return True
    elif not os.path.exists(cfg_path) and logging is False:
        logger.info(
            '%s: No pre-existing configuration file found at %s. Using defaults. Logging disabled.' %
            (inspect.stack()[0][3], cfg_path)
            )
        return True
    if logging:
        logger.info(
            '%s: Logging enabled per config file (%s).' %
            (inspect.stack()[0][3], cfg_path)
            )
        return True
    return False