static ITCResourceMatcher getMatcherFor()

in command.line/java/com/jetbrains/teamcity/resources/TCWorkspace.java [51:69]


  static ITCResourceMatcher getMatcherFor(@NotNull final File local) throws IllegalArgumentException {
    // per-folder search
    try {
      File folder = local.getParentFile();
      if (folder != null) {
        folder = folder.getCanonicalFile().getAbsoluteFile();
        final File adminFile = new File(folder, TCC_ADMIN_FILE);
        if (adminFile.exists()) {
          Debug.getInstance().debug(TCWorkspace.class, String.format("found mapping for %s in %s", local, adminFile));
          return new FileBasedMatcher(adminFile);
        } else {
          return getMatcherFor(folder);
        }
      }
    } catch (IOException e) {
      throw new IllegalArgumentException(e);
    }
    return null;
  }