public final class PackageURL extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
PackageURL.StandardTypes
Convenience constants that defines common PackageURL 'type's.
|
| Constructor and Description |
|---|
PackageURL(String purl)
Constructs a new PackageURL object by parsing the specified string.
|
PackageURL(String type,
String name)
Constructs a new PackageURL object by specifying only the required
parameters necessary to create a valid PackageURL.
|
PackageURL(String type,
String namespace,
String name,
String version,
TreeMap<String,String> qualifiers,
String subpath)
Constructs a new PackageURL object.
|
| Modifier and Type | Method and Description |
|---|---|
String |
canonicalize()
Returns a canonicalized representation of the purl.
|
String |
getName()
Returns the name of the package.
|
String |
getNamespace()
Returns the name prefix such as a Maven groupid, a Docker image owner, a GitHub user or organization.
|
Map |
getQualifiers()
Returns extra qualifying data for a package such as an OS, architecture, a distro, etc.
|
String |
getScheme()
Returns the package url scheme.
|
String |
getSubpath()
Returns extra subpath within a package, relative to the package root.
|
String |
getType()
Returns the package "type" or package "protocol" such as maven, npm, nuget, gem, pypi, etc.
|
String |
getVersion()
Returns the version of the package.
|
public PackageURL(String purl) throws MalformedPackageURLException
purl - a valid package URL string to parseMalformedPackageURLException - if parsing failspublic PackageURL(String type, String name) throws MalformedPackageURLException
type - the type of package (i.e. maven, npm, gem, etc)name - the name of the packageMalformedPackageURLException - if parsing failspublic PackageURL(String type, String namespace, String name, String version, TreeMap<String,String> qualifiers, String subpath) throws MalformedPackageURLException
type - the type of package (i.e. maven, npm, gem, etc)namespace - the name prefix (i.e. group, owner, organization)name - the name of the packageversion - the version of the packagequalifiers - an array of key/value pair qualifierssubpath - the subpath stringMalformedPackageURLException - if parsing failspublic String getScheme()
public String getType()
public String getNamespace()
public String getName()
public String getVersion()
public Map getQualifiers()
public String getSubpath()
public String canonicalize()
Copyright © 2017–2018. All rights reserved.