Returns project residing in given directory, if no such is found then null is returned.
514779
private Project findProjectInDirectory(Resource<?> target, ProjectProvider projectProvider,
            Predicate<Project> filter)
   {
      Project result = null;
      Imported<ProjectCache> caches = getCaches();
      if (projectProvider.containsProject(target))
      {
         boolean cached = false;
         for (ProjectCache cache : caches)
         {
            result = cache.get(target);
            if (result != null && !filter.accept(result))
            {
               result = null;
            }
            if (result != null)
            {
               cached = true;
               break;
            }
         }
         if (result == null)
         {
            result = projectProvider.createProject(target);
         }
         if (result != null && !filter.accept(result))
         {
            result = null;
         }
         if (result != null && !cached)
         {
            registerAvailableFacets(result);
            cacheProject(result);
         }
      }

      return result;
   }
833629
@Nullable
  public static File findFile(@Nullable final Class<?> clazz) {
    if (null == clazz) return null;
    String name = clazz.getName();
    if (null == name) return null;
    final String path = name.replaceAll("\\.", "/").replaceAll("\\$.*", "");
    return com.simiacryptus.util.lang.CodeUtil.findFile(path + ".java");
  }
250564
def getProjectDescriptor(self, dir):
		
		for project in glob.glob(os.path.join(dir, '*.uproject')):
			return os.path.realpath(project)
		
		# No project detected
		raise UnrealManagerException('could not detect an Unreal project in the current directory')
1008454
String getJsDirectory(Map<String, String> options) {
		if (null != options) {
			if (options.containsKey(ProcessorConstants.DIRECTORY)) {
				return options.get(ProcessorConstants.DIRECTORY);
			}
		}
		return null;
	}
1095667
private ProjectFile handleDatabaseInDirectory(File directory) throws Exception
   {
      byte[] buffer = new byte[BUFFER_SIZE];
      File[] files = directory.listFiles();
      if (files != null)
      {
         for (File file : files)
         {
            if (file.isDirectory())
            {
               continue;
            }

            FileInputStream fis = new FileInputStream(file);
            int bytesRead = fis.read(buffer);
            fis.close();

            //
            // If the file is smaller than the buffer we are peeking into,
            // it's probably not a valid schedule file.
            //
            if (bytesRead != BUFFER_SIZE)
            {
               continue;
            }

            if (matchesFingerprint(buffer, BTRIEVE_FINGERPRINT))
            {
               return handleP3BtrieveDatabase(directory);
            }

            if (matchesFingerprint(buffer, STW_FINGERPRINT))
            {
               return handleSureTrakDatabase(directory);
            }
         }
      }
      return null;
   }
1123011
function findPackage(dir, packageName) {
    let d = dir || '.';
    do {
        let f = path.join(d, 'package.json');
        if ( fs.existsSync(f) ) {
            // require(f) would look for paths relative to this module,
            // but we need it to be relative to process.cwd()
            if ( !path.isAbsolute(f) ) {
                f = fs.realpathSync(f);
            }
            const p = requireJSON(f);
            // Look for a specific project name
            if ( packageName ) {
                if ( p ) {
                    if ( p.name == packageName ) {
                        return f;
                    }
                }
            }
            // Look for any project except this one (verup)
            else {
                if ( p ) {
                    if ( (p.extra && p.extra.verup || p.verup) && p.name != 'verup' ) {
                        return f;
                    }
                }
            }
        }
        dir = d;
        d = path.join(d, '..');
    } while (d != dir && dir.slice(0,2) != '..');
    return false;
}
647969
def getDescriptor(self, dir):
		
		try:
			return self.getProjectDescriptor(dir)
		except:
			try:
				return self.getPluginDescriptor(dir)
			except:
				raise UnrealManagerException('could not detect an Unreal project or plugin in the directory "{}"'.format(dir))
1043578
@Nullable
  private DirectoryEntry lookUpLast(
      @Nullable File dir, Name name, Set<? super LinkOption> options, int linkDepth)
      throws IOException {
    Directory directory = toDirectory(dir);
    if (directory == null) {
      return null;
    }

    DirectoryEntry entry = directory.get(name);
    if (entry == null) {
      return new DirectoryEntry(directory, name, null);
    }

    File file = entry.file();
    if (!options.contains(LinkOption.NOFOLLOW_LINKS) && file.isSymbolicLink()) {
      return followSymbolicLink(dir, (SymbolicLink) file, linkDepth);
    }

    return getRealEntry(entry);
  }
492319
public Project getProject(final int id) {
    Project fetchedProject = this.projectsById.get(id);
    if (fetchedProject == null) {
      try {
        fetchedProject = this.projectLoader.fetchProjectById(id);
      } catch (final ProjectManagerException e) {
        logger.error("Could not load project from store.", e);
      }
    }
    return fetchedProject;
  }
1037606
@OverrideOnDemand
  protected boolean recurseIntoDirectory (@Nonnull final File aDirectory)
  {
    return m_aRecursionFilter == null || m_aRecursionFilter.test (aDirectory);
  }
1163500
def find_project_dir(path=os.getcwd()):
    """"""
    path_split = os.path.split(path)
    while path_split[1]:
        if in_armstrong_project(path):
            return path
        path = path_split[0]
        path_split = os.path.split(path)
    # we ran out of parents
    return None
826272
public CollectionRequest<Task> findByProject(String projectId) {
    
        String path = String.format("/projects/%s/tasks", projectId);
        return new CollectionRequest<Task>(this, Task.class, path, "GET");
    }
601325
function getProjectPathFromHubID(id) {
		var query = sharedProject.findOne({hubid: id}, 'location');
		return query.exec()
		.then(function(doc) {
			return doc ? doc.location : undefined;
		});
	}
661469
def __load_project_from_file_path(file_path):
    '''
    
    '''
    try:
        project = get_project(project_dir=os.path.dirname(file_path),
                              config_path=[os.path.basename(file_path)])
    except Exception as inst:
        return __handle_except(inst)
    return project
1176050
private List<File> getUidFilesForProject(String category, String projectName) {
		// Check that the category directory exists
		File categoryDirectory = new File(uidDirectory, category);
		if (!categoryDirectory.exists() || (categoryDirectory.exists() && categoryDirectory.isFile())) {
			return new ArrayList<>();
		}
		
		// Check that the project directory exists
		File projectDirectory = new File(categoryDirectory, projectName);
		if (!projectDirectory.exists() || (projectDirectory.exists() && projectDirectory.isFile())) {
			return new ArrayList<>();
		}

		// Get all the version directories
		List<File> versionDirectories = new ArrayList<>();
		for (File electableDirectory : projectDirectory.listFiles()) {
			if (electableDirectory.isDirectory()) {
				versionDirectories.add(electableDirectory);
			}
		}
		
		return versionDirectories;
	}
25872
@Nullable
  Directory getRoot(Name name) {
    DirectoryEntry entry = tree.getRoot(name);
    return entry == null ? null : (Directory) entry.file();
  }
978624
private String getProjectFile( String projectName, String filePattern)
    {
    String projectFile = null;
    if( !StringUtils.isBlank( filePattern))
      {
      Matcher matcher = projectFilePattern_.matcher( filePattern);
      if( matcher.matches())
        {
        projectFile =
          StringUtils.isBlank( matcher.group(2))
          ? filePattern
          : matcher.group(1) + projectName + matcher.group(3);
        }
      }
    
    return projectFile;
    }