Class ClassPathResourceMetadataLoader

java.lang.Object
com.google.i18n.phonenumbers.metadata.init.ClassPathResourceMetadataLoader
All Implemented Interfaces:
MetadataLoader

public final class ClassPathResourceMetadataLoader extends Object implements MetadataLoader
A MetadataLoader implementation that reads phone number metadata files as classpath resources.
  • Constructor Details

    • ClassPathResourceMetadataLoader

      public ClassPathResourceMetadataLoader()
  • Method Details

    • loadMetadata

      public InputStream loadMetadata(String metadataFileName)
      Description copied from interface: MetadataLoader
      Returns an input stream corresponding to the metadata to load. This method may be called concurrently so implementations must be thread-safe.
      Specified by:
      loadMetadata in interface MetadataLoader
      Parameters:
      metadataFileName - file name (including path) of metadata to load. File path is an absolute class path like /com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto
      Returns:
      the input stream for the metadata file. The library will close this stream after it is done. Return null in case the metadata file could not be found