Class HttpNpmRemote

  • All Implemented Interfaces:
    NpmRemote, Closeable, AutoCloseable

    public final class HttpNpmRemote
    extends Object
    implements NpmRemote
    Base NPM Remote client implementation. It calls remote NPM repository to download NPM packages and assets. It uses underlying Vertx Web Client inside and works in Rx-way.
    Since:
    0.1
    • Method Detail

      • loadPackage

        public io.reactivex.Maybe<NpmPackage> loadPackage​(String name)
        Description copied from interface: NpmRemote
        Loads package from remote repository.
        Specified by:
        loadPackage in interface NpmRemote
        Parameters:
        name - Package name
        Returns:
        NPM package or empty
      • loadAsset

        public io.reactivex.Maybe<NpmAsset> loadAsset​(String path,
                                                      Path tmp)
        Description copied from interface: NpmRemote
        Loads asset from remote repository. Typical usage for client:
         Path tmp = <create temporary file>
         NpmAsset asset = remote.loadAsset(asset, tmp);
         ... consumes asset's data ...
         Files.delete(tmp);
         
        Specified by:
        loadAsset in interface NpmRemote
        Parameters:
        path - Asset path
        tmp - Temporary file to store asset data
        Returns:
        NpmAsset or empty