Check if the file presave.js exists in the root of the library

@param string $libraryFolder
@param string $developmentPath
@return bool
358024
public function hasPresave($libraryFolder, $developmentPath = null) {
      $path = is_null($developmentPath) ? 'libraries' . DIRECTORY_SEPARATOR . $libraryFolder : $developmentPath;
      $filePath = realpath($this->path . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . 'presave.js');
    return file_exists($filePath);
  }
279635
public function isStaticFile($sitePath, $siteName, $uri)
    {
        $this->checkMageMode($sitePath);

        $uri = $this->handleForVersions($uri);
        $route = parse_url(substr($uri, 1))['path'];

        $pub = '';
        if ('developer' === $this->mageMode) {
            $pub = 'pub/';
        }

        if (!$this->isPubDirectory($sitePath, $route, $pub)) {
            return false;
        }

        $magentoPackagePubDir = $sitePath;
        if ('developer' !== $this->mageMode) {
            $magentoPackagePubDir .= '/pub';
        }

        $file = $magentoPackagePubDir . '/' . $route;

        if (file_exists($file)) {
            return $magentoPackagePubDir . $uri;
        }

        if (strpos($route, $pub . 'static/') === 0) {
            $route = preg_replace('#' . $pub . 'static/#', '', $route, 1);
            $_GET['resource'] = $route;
            include $magentoPackagePubDir . '/' . $pub . 'static.php';
            exit;
        }

        if (strpos($route, $pub . 'media/') === 0) {
            include $magentoPackagePubDir . '/' . $pub . 'get.php';
            exit;
        }

        return false;
    }
1347914
private static boolean isSavedInDir(ScriptWrapper scriptWrapper, File directory) {
		File file = scriptWrapper.getFile();
		if (file == null) {
			return false;
		}
		return file.getParentFile().equals(directory);
	}
601700
public function exists($language, $basePath = ANPATH_BASE)
	{
        $directory = $this->getLanguagePath($basePath, $language);
        return is_dir($directory);
	}
1076857
function exists( $checkDFSFile = false )
    {
        eZDebugSetting::writeDebug( 'kernel-clustering', "dfs::exists( '$this->filePath' )" );
        return self::$dbbackend->_exists( $this->filePath, false, true, $checkDFSFile );
    }
1272880
static String saveLibrary(final File dir, final String libraryName) throws IOException {
    String libraryFileName = "lib" + libraryName;

    URL libraryResource = findLibraryResource(libraryFileName);

    String basename = FilenameUtils.getName(libraryResource.getPath());
    File file = new File(dir, basename);
    file.deleteOnExit();

    try (
        InputStream in = libraryResource.openStream();
        OutputStream out = new FileOutputStream(file)
    ) {
      IOUtils.copy(in, out);
    }

    LOG.trace("Library \"{}\" copied to \"{}\"", libraryName, file.getAbsolutePath());

    return file.getAbsolutePath();
  }
287398
protected function cacheFile(IFile $file, FileFormatter $formatter, string $targetPath): bool
    {
        if ($file instanceof ICacheStateful && $file->getIsCached($formatter->name)) {
            return true;
        }

        return (new Saver($file, $this->cacheFS, $targetPath))->save($formatter);
    }
852433
public function saveLibrary($library) {
    $dest = $this->path . '/libraries/' . \H5PCore::libraryToString($library, TRUE);

    // Make sure destination dir doesn't exist
    \H5PCore::deleteFileTree($dest);

    // Move library folder
    self::copyFileTree($library['uploadDirectory'], $dest);
  }
291418
public static boolean isExclusivelyKnownArchive(GraphRewrite event, String filePath)
    {
        String extension = StringUtils.substringAfterLast(filePath, ".");

        if (!StringUtils.equalsIgnoreCase(extension, "jar"))
            return false;

        ZipFile archive;
        try
        {
            archive = new ZipFile(filePath);
        } catch (IOException e)
        {
            return false;
        }

        WindupJavaConfigurationService javaConfigurationService = new WindupJavaConfigurationService(event.getGraphContext());
        WindupJavaConfigurationModel javaConfigurationModel = WindupJavaConfigurationService.getJavaConfigurationModel(event.getGraphContext());

        // indicates that the user did specify some packages to scan explicitly (as opposed to scanning everything)
        boolean customerPackagesSpecified = javaConfigurationModel.getScanJavaPackages().iterator().hasNext();

        // this should only be true if:
        // 1) the package does not contain *any* customer packages.
        // 2) the package contains "known" vendor packages.
        boolean exclusivelyKnown = false;

        String organization = null;
        Enumeration<?> e = archive.entries();

        // go through all entries...
        ZipEntry entry;
        while (e.hasMoreElements())
        {
            entry = (ZipEntry) e.nextElement();
            String entryName = entry.getName();

            if (entry.isDirectory() || !StringUtils.endsWith(entryName, ".class"))
                continue;

            String classname = PathUtil.classFilePathToClassname(entryName);
            // if the package isn't current "known", try to match against known packages for this entry.
            if (!exclusivelyKnown)
            {
                organization = getOrganizationForPackage(event, classname);
                if (organization != null)
                {
                    exclusivelyKnown = true;
                } else
                {
                    // we couldn't find a package definitively, so ignore the archive
                    exclusivelyKnown = false;
                    break;
                }
            }

            // If the user specified package names and this is in those package names, then scan it anyway
            if (customerPackagesSpecified && javaConfigurationService.shouldScanPackage(classname))
            {
                return false;
            }
        }

        if (exclusivelyKnown)
            LOG.info("Known Package: " + archive.getName() + "; Organization: " + organization);

        // Return the evaluated exclusively known value.
        return exclusivelyKnown;
    }
1181733
public static synchronized boolean existsStorage(final File pStoragePath) {
        // if file is existing and folder is a tt-dataplace, delete it
        if (pStoragePath.exists()
            && IOUtils.compareStructure(pStoragePath, StorageConfiguration.Paths.values()) == 0) {
            return true;
        } else {
            return false;
        }

    }
930681
function(){
        var path = $options.path;

        $fs.exists("fis-conf.js", function(res){
            if(res == true){
                $fs.exists(path, function(res){
                    if(res == true){
                        console.log("[Error-1001] This path:"+path+" exists");
                    }else{
                        snippets.fn.appFolder(path);
                    }
                });
            }else{
                console.log("[Error-1002] In this folder that can't build widget or page folders");
            }
        });
    }
375555
function isDirectory(filePath) {
  if (!isExist(filePath)) return false;
  try {
    const stat = fs.statSync(filePath);
    return stat.isDirectory();
  } catch (e) {
    return false;
  }
}
253368
function _libraryFiles(directory) {
	return new Promise((fulfill) => {
		const files = [];
		klaw(directory)
			.on('data', (item) => {
				const relativePath = path.relative(directory, item.path);
				files.push(relativePath);
			})
			.on('end', () => {
				fulfill(files);
			});
	});
}
614277
private static boolean extractAndLoadLibraryFile(String libFolderForCurrentOS, String libraryFileName,
                                                     String targetFolder) {
        String nativeLibraryFilePath = libFolderForCurrentOS + "/" + libraryFileName;
        // Include architecture name in temporary filename in order to avoid conflicts
        // when multiple JVMs with different architectures running at the same time
        String uuid = UUID.randomUUID().toString();
        String extractedLibFileName = String.format("secp256k1-%s-%s", uuid, libraryFileName);
        String extractedLckFileName = extractedLibFileName + ".lck";

        File extractedLibFile = new File(targetFolder, extractedLibFileName);
        File extractedLckFile = new File(targetFolder, extractedLckFileName);

        try {
            // Extract a native library file into the target directory
            InputStream reader = Secp256k1Loader.class.getResourceAsStream(nativeLibraryFilePath);
            if(!extractedLckFile.exists()) {
                new FileOutputStream(extractedLckFile).close();
            }
            FileOutputStream writer = new FileOutputStream(extractedLibFile);
            try {
                byte[] buffer = new byte[8192];
                int bytesRead = 0;
                while((bytesRead = reader.read(buffer)) != -1) {
                    writer.write(buffer, 0, bytesRead);
                }
            }
            finally {
                // Delete the extracted lib file on JVM exit.
                extractedLibFile.deleteOnExit();
                extractedLckFile.deleteOnExit();


                if(writer != null) {
                    writer.close();
                }
                if(reader != null) {
                    reader.close();
                }
            }

            // Set executable (x) flag to enable Java to load the native library
            extractedLibFile.setReadable(true);
            extractedLibFile.setWritable(true, true);
            extractedLibFile.setExecutable(true);

            // Check whether the contents are properly copied from the resource folder
            {
                InputStream nativeIn = Secp256k1Loader.class.getResourceAsStream(nativeLibraryFilePath);
                InputStream extractedLibIn = new FileInputStream(extractedLibFile);
                try {
                    if(!contentsEquals(nativeIn, extractedLibIn)) {
                        throw new RuntimeException(String.format("Failed to write a native library file at %s", extractedLibFile));
                    }
                }
                finally {
                    if(nativeIn != null) {
                        nativeIn.close();
                    }
                    if(extractedLibIn != null) {
                        extractedLibIn.close();
                    }
                }
            }
            return loadNativeLibrary(targetFolder, extractedLibFileName);
        }
        catch(IOException e) {
            System.err.println(e.getMessage());
            return false;
        }

    }
59202
def is_app_folder(self, folder):
    
    with open('%s/%s/build.gradle' % (self.path, folder)) as f:
      for line in f.readlines():
        if config.gradle_plugin in line:
          return True
    return False
627233
public static void addLibraryPath(String libraryPath) {
        for (String libraryName : LIBRARY_NAMES) {
	    NativeLibrary.addSearchPath(libraryName, libraryPath);
        }
    }
1246968
public static function isValid(string $filePath): bool
    {
        return self::myFilePathParse(
            DIRECTORY_SEPARATOR,
            $filePath,
            function ($p, $d, &$e) {
                return self::myPartValidator($p, $d, $e);
            });
    }