java/serving/src/main/java/feast/serving/config/ApplicationPropertiesModule.java
private byte[] readPropertiesFile(String filePath) throws IOException {
    if (filePath.startsWith("classpath:")) {
      filePath = filePath.substring("classpath:".length());
      if (filePath.startsWith("/")) {
        filePath = filePath.substring(1);
      }

      return Resources.toByteArray(Resources.getResource(filePath));
    }

    if (filePath.startsWith("file")) {
      filePath = filePath.substring("file:".length());
    }

    return Files.readAllBytes(Path.of(filePath));
  }
/**
   * Read file path in spring compatible format, eg classpath:/application.yml or
   * file:/path/application.yml
   */
Read file path in spring compatible format, eg classpath:/application.yml or
file:/path/application.yml
Read file path in spring compatible format eg classpath : / application . yml or file : / path / application . yml
private byte[] readPropertiesFile(String filePath) throws IOException {
    if (filePath.startsWith("classpath:")) {
      filePath = filePath.substring("classpath:".length());
      if (filePath.startsWith("/")) {
        filePath = filePath.substring(1);
      }
      return Resources.toByteArray(Resources.getResource(filePath));
    }
    if (filePath.startsWith("file")) {
      filePath = filePath.substring("file:".length());
    }
    return Files.readAllBytes(Path.of(filePath));
  }
private byte [ ] readPropertiesFile ( String filePath ) throws IOException { if ( filePath . startsWith ( "classpath:" ) ) { filePath = filePath . substring ( "classpath:" . length ( ) ) ; if ( filePath . startsWith ( "/" ) ) { filePath = filePath . substring ( 1 ) ; } return Resources . toByteArray ( Resources . getResource ( filePath ) ) ; } if ( filePath . startsWith ( "file" ) ) { filePath = filePath . substring ( "file:" . length ( ) ) ; } return Files . readAllBytes ( Path . of ( filePath ) ) ; }
Read file path in spring compatible format, eg classpath:/application.yml or
 file:/path/application.yml
Read file path in spring compatible format eg classpath : / application . yml or file : / path / application . yml