code: public static Integer convertPathIdentifier(String identifier, Integer profileId) throws Exception {
          Integer pathId = -1;
          try {
              pathId = Integer.parseInt(identifier);
          } catch (NumberFormatException ne) {
              // this is OK.. just means it's not a #
              if (profileId == null)
                  throw new Exception("A profileId must be specified");
  
              pathId = PathOverrideService.getInstance().getPathId(identifier, profileId);
          }
  
          return pathId;
      }
docs: Obtain the path ID for a profile
  
  @param identifier Can be the path ID, or friendly name
  @param profileId
  @return
  @throws Exception