Class ClassPathResourceMetadataLoader

  • All Implemented Interfaces:
    MetadataLoader

    public final class ClassPathResourceMetadataLoader
    extends java.lang.Object
    implements MetadataLoader
    A MetadataLoader implementation that reads phone number metadata files as classpath resources.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.InputStream loadMetadata​(java.lang.String metadataFileName)
      Returns an input stream corresponding to the metadata to load.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassPathResourceMetadataLoader

        public ClassPathResourceMetadataLoader()
    • Method Detail

      • loadMetadata

        public java.io.InputStream loadMetadata​(java.lang.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