code: protected RegisteredService getRegisteredServiceFromFile(final File file) {
          val fileName = file.getName();
          if (fileName.startsWith(".")) {
              LOGGER.trace("[{}] starts with ., ignoring", fileName);
              return null;
          }
          if (Arrays.stream(getExtensions()).noneMatch(fileName::endsWith)) {
              LOGGER.trace("[{}] doesn't end with valid extension, ignoring", fileName);
              return null;
          }
          val matcher = this.serviceFileNamePattern.matcher(fileName);
          if (matcher.find()) {
              val serviceId = matcher.group(2);
              if (NumberUtils.isCreatable(serviceId)) {
                  val id = Long.parseLong(serviceId);
                  return findServiceById(id);
              }
              val serviceName = matcher.group(1);
              return findServiceByExactServiceName(serviceName);
          }
          LOGGER.warn("Provided file [{}} does not match the recommended service definition file pattern [{}]",
              file.getName(),
              this.serviceFileNamePattern.pattern());
          return null;
      }
docs: Gets registered service from file.
  
  @param file the file
  @return the registered service from file