Interface MetadataLoader

  • All Known Implementing Classes:
    ClassPathResourceMetadataLoader

    public interface MetadataLoader
    Interface for clients to specify a customized phone metadata loader, useful for Android apps to load Android resources since the library loads Java resources by default, e.g. with AssetManager. Note that implementation owners have the responsibility to ensure this is thread-safe.
    • Method Detail

      • loadMetadata

        InputStream loadMetadata​(String metadataFileName)
        Returns an input stream corresponding to the metadata to load. This method may be called concurrently so implementations must be thread-safe.
        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