@param bool        $execOption
@param bool        $noExecOption
@param string|null $filePath

@return bool
544674
private function shouldExecuteFile($execOption, $noExecOption, $filePath)
    {
        if ($execOption) {
            return true;
        }

        if ($noExecOption) {
            return false;
        }

        // By default, code that is edited is executed if there was no given input file path
        return $filePath === null;
    }
442978
private boolean checkCommonPropExistance(Path rootPath, String noExtFileName)
      throws IOException {
    Configuration conf = new Configuration();
    FileStatus[] children = rootPath.getFileSystem(conf).listStatus(rootPath);

    for (FileStatus aChild : children) {
      if (aChild.getPath().getName().contains(noExtFileName)) {
        return false;
      }
    }
    return true;
  }
918144
public static function exec($binPath = null, $cb = null, $args = null, $env = null)
    {
        $o = new static;
        $data = '';
        $o->bind('read', function ($o) use (&$data) {
            $data .= $o->readUnlimited();
        });
        $o->bind('eof', function ($o) use (&$data, $cb) {
            $cb($o, $data);
            $o->close();
        });
        $o->execute($binPath, $args, $env);
    }
1345349
public function create($type, array $initOptions = array(), array $execOptions = array())
    {
        return $this->createBuilder($type, $initOptions, $execOptions)->getJob();
    }
713955
public static function setOption($optionName = "", $optionValue = "") {
		
		if (empty($optionName) || empty($optionValue)) {
			return false;
		}
		
		$arrayFinder = new ArrayFinder(self::$options);
		$arrayFinder->set($optionName, $optionValue);
		self::$options = $arrayFinder->get();
		
	}
1343916
public static function safeFileWrite($filepath, $str = '', $opts = array())
	{
		$return = false;
		$opts = array_merge(array(
			'est_size' => strlen($str),
		), $opts);
		$fh = self::safeFopen($filepath, $opts);
		if ($fh) {
			if (fwrite($fh, $str) !== false) {
				$return = true;
			} else {
				trigger_error('Error writing to '.$filepath, E_USER_ERROR);
			}
			self::safeFclose($fh);
		}
		return $return;
	}
243446
function doesFileExist(filePath) {
    if (!fileExistsCache.hasOwnProperty(filePath)) {
        fileExistsCache[filePath] = fs.existsSync(filePath);
    }

    return fileExistsCache[filePath];
}
606061
public function readFile($filePath = null, array $options = [])
    {
        $filePath = empty($filePath)
            ? $this->filePath
            : $filePath;

        $defaultOptions = [
            'length'    => 1000,
            'delimiter' => ',',
        ];

        $options = array_merge($defaultOptions, $options);

        $result = [];

        if (false !== ($handle = fopen($filePath, 'r'))) {
            while (false !== ($data = fgetcsv($handle, $options[ 'length' ], $options[ 'delimiter' ]))) {
                $result[] = fgetcsv($handle);
            }
        }

        return $result;
    }
458280
public function fileExists($containerName, $fileName, $relativePath)
    {
        return $this->fileUploadFacade->fileExists($containerName, $fileName, $relativePath);
    }
457170
public function fileExists($containerName, $fileName, $relativePath)
    {
        return $this->getFactory()
            ->createStorage($containerName)
            ->fileExists($containerName, $fileName, $relativePath);
    }
281391
public function setNamespaceFromPath(string $filePath, string $srcSubFolderName, string $projectRootNamespace): self
    {
        $pathForNamespace = substr(
            $filePath,
            \ts\strpos(
                $filePath,
                $srcSubFolderName
            )
            + \strlen($srcSubFolderName)
            + 1
        );
        $pathForNamespace = substr($pathForNamespace, 0, strrpos($pathForNamespace, '/'));
        $namespaceToSet   = $projectRootNamespace
                            . '\\' . implode(
                                '\\',
                                explode(
                                    '/',
                                    $pathForNamespace
                                )
                            );
        $contents         = \ts\file_get_contents($filePath);
        $contents         = preg_replace(
            '%namespace[^:]+?;%',
            "namespace $namespaceToSet;",
            $contents,
            1,
            $count
        );
        if ($count !== 1) {
            throw new DoctrineStaticMetaException(
                'Namespace replace count is ' . $count . ', should be 1 when updating file: ' . $filePath
            );
        }
        file_put_contents($filePath, $contents);

        return $this;
    }
691713
public function getCachedPdfPreview(string $pdfPath, array $options = [], string $fileExtension = 'jpg')
    {
        $pdfCache = $this;
        $imagePath = $this->cache->get($pdfPath, $fileExtension, function ($pdfPath, $cachePath, $cacheFileName) use ($pdfCache, $options) {
            return $pdfCache->generatePdfPreview($pdfPath, $cachePath.'/'.$cacheFileName, $options);
        });

        return $imagePath ? $imagePath : null;
    }
994431
public function open(string $filePath, string $mode)
    {
        $this->exists($filePath, $mode);

        $ptr = @fopen($filePath, $mode);

        if (false === $ptr) {
            throw new FileException("Unable to open $filePath.");
        }

        return $ptr;
    }
1242375
public function write($filePath, $contents, $mode = 'wb')
    {
        if (false !== ($fp = $this->create($filePath, $mode))) {
            flock($fp, LOCK_EX);

            for ($result = $written = 0, $length = strlen($contents); $written < $length; $written += $result) {
                if (($result = fwrite($fp, substr($contents, $written))) === false) {
                    break;
                }
            }

            flock($fp, LOCK_UN);
            fclose($fp);

            return is_int($result);
        }

        return false;
    }
479712
public static boolean createFile(String filePath) {
        if (!StringUtils.isEmpty(filePath)) {
            File file = new File(filePath);
            return createFile(file);
        }
        return false;
    }
774778
protected function createNonreusableSignature($bucket, $filepath)
    {
        if (preg_match('/^\//', $filepath) == 0) {
            $filepath = '/' . $filepath;
        }

        $fileId = '/' . $this->config->get('app_id') . '/' . $bucket . $filepath;

        return $this->createSignature(0, $bucket, $fileId);
    }
779867
private void loadOptionsFromFile(String filepath){
        try {
            BufferedReader in = new BufferedReader(new FileReader(filepath));

            String stream0 = in.readLine();
            outlierAlgoPanel0.setStreamValueAsCLIString(stream0);

            String algo0 = in.readLine();
            outlierAlgoPanel0.setAlgorithm0ValueAsCLIString(algo0);

            System.out.println("Loading settings from "+filepath);
            logPanel.addText("Loading settings from "+filepath);

        } catch (Exception e) {
            System.out.println("Bad option file:"+e.getMessage());
        }
    }