Package com.artipie.npm.proxy
Class NpmProxy
- java.lang.Object
-
- com.artipie.npm.proxy.NpmProxy
-
public class NpmProxy extends Object
NPM Proxy.- Since:
- 0.1
-
-
Constructor Summary
Constructors Constructor Description NpmProxy(NpmProxyConfig config, io.vertx.reactivex.core.Vertx vertx, com.artipie.asto.Storage storage)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close NPM Proxy adapter and underlying remote client.io.reactivex.Maybe<NpmAsset>
getAsset(String path)
Retrieve asset.io.reactivex.Maybe<NpmPackage>
getPackage(String name)
Retrieve package metadata.
-
-
-
Constructor Detail
-
NpmProxy
public NpmProxy(NpmProxyConfig config, io.vertx.reactivex.core.Vertx vertx, com.artipie.asto.Storage storage)
Ctor.- Parameters:
config
- NPM Proxy configurationvertx
- Vertx instancestorage
- Adapter storage
-
-
Method Detail
-
getPackage
public io.reactivex.Maybe<NpmPackage> getPackage(String name)
Retrieve package metadata.- Parameters:
name
- Package name- Returns:
- Package metadata (cached or downloaded from remote repository)
-
getAsset
public io.reactivex.Maybe<NpmAsset> getAsset(String path)
Retrieve asset.- Parameters:
path
- Asset path- Returns:
- Asset data (cached or downloaded from remote repository)
-
close
public void close() throws IOException
Close NPM Proxy adapter and underlying remote client.- Throws:
IOException
- when underlying remote client fails to close
-
-