diff --git a/core/src/main/java/org/eclipse/dash/licenses/PurlIdParser.java b/core/src/main/java/org/eclipse/dash/licenses/PackageUrlIdParser.java similarity index 94% rename from core/src/main/java/org/eclipse/dash/licenses/PurlIdParser.java rename to core/src/main/java/org/eclipse/dash/licenses/PackageUrlIdParser.java index f3b149b8..bbd6a4e5 100644 --- a/core/src/main/java/org/eclipse/dash/licenses/PurlIdParser.java +++ b/core/src/main/java/org/eclipse/dash/licenses/PackageUrlIdParser.java @@ -13,7 +13,7 @@ import java.util.regex.Pattern; /** - * Parse ids specified in the purl format. + * Parse ids specified in the Package URL format. * *
* The purl format is specified here: https://github.com/package-url/purl-spec @@ -21,7 +21,7 @@ *
* From the documentation (which is licensed under MIT)... * - *
The defintion for each components is: + *The definition for each components is: **
- scheme: this is the URL scheme with the constant value * of "pkg". One of the primary reason for this single scheme is to facilitate @@ -44,7 +44,7 @@ * Strictly speaking, the version is considered optional. For our purposes, * we've made it mandatory. */ -public class PurlIdParser implements ContentIdParser { +public class PackageUrlIdParser implements ContentIdParser { // @formatter:off private static final String PURL_PATTERN = diff --git a/core/src/main/java/org/eclipse/dash/licenses/cli/FlatFileReader.java b/core/src/main/java/org/eclipse/dash/licenses/cli/FlatFileReader.java index d1cb6e0a..b7aa7aee 100644 --- a/core/src/main/java/org/eclipse/dash/licenses/cli/FlatFileReader.java +++ b/core/src/main/java/org/eclipse/dash/licenses/cli/FlatFileReader.java @@ -23,7 +23,7 @@ import org.eclipse.dash.licenses.InvalidContentId; import org.eclipse.dash.licenses.MavenIdParser; import org.eclipse.dash.licenses.NpmJsIdParser; -import org.eclipse.dash.licenses.PurlIdParser; +import org.eclipse.dash.licenses.PackageUrlIdParser; public class FlatFileReader implements IDependencyListReader { @@ -35,7 +35,7 @@ public class FlatFileReader implements IDependencyListReader { public FlatFileReader(Reader input) { reader = new BufferedReader(input); parsers.add(new MavenIdParser()); - parsers.add(new PurlIdParser()); + parsers.add(new PackageUrlIdParser()); parsers.add(new NpmJsIdParser()); parsers.add(new GolangIdParser()); parsers.add(new ClearlyDefinedIdParser()); diff --git a/core/src/test/java/org/eclipse/dash/licenses/tests/PurlIdParserTests.java b/core/src/test/java/org/eclipse/dash/licenses/tests/PackageUrlIdParserTests.java similarity index 65% rename from core/src/test/java/org/eclipse/dash/licenses/tests/PurlIdParserTests.java rename to core/src/test/java/org/eclipse/dash/licenses/tests/PackageUrlIdParserTests.java index e7f63054..71b5a371 100644 --- a/core/src/test/java/org/eclipse/dash/licenses/tests/PurlIdParserTests.java +++ b/core/src/test/java/org/eclipse/dash/licenses/tests/PackageUrlIdParserTests.java @@ -12,32 +12,32 @@ import static org.junit.Assert.assertNull; import static org.junit.jupiter.api.Assertions.assertEquals; -import org.eclipse.dash.licenses.PurlIdParser; +import org.eclipse.dash.licenses.PackageUrlIdParser; import org.junit.jupiter.api.Test; -class PurlIdParserTests { +class PackageUrlIdParserTests { @Test void testBasic1() { assertEquals("bitbucket/-/birkenfeld/pygments-main/244fd47e07d1014f0aed9c", - new PurlIdParser().parseId("pkg:bitbucket/birkenfeld/pygments-main@244fd47e07d1014f0aed9c").toString()); + new PackageUrlIdParser().parseId("pkg:bitbucket/birkenfeld/pygments-main@244fd47e07d1014f0aed9c").toString()); assertEquals("deb/-/debian/curl/7.50.3-1", - new PurlIdParser().parseId("pkg:deb/debian/curl@7.50.3-1?arch=i386&distro=jessie").toString()); - assertEquals("npm/npmjs/-/foobar/12.3.1", new PurlIdParser().parseId("pkg:npm/foobar@12.3.1").toString()); + new PackageUrlIdParser().parseId("pkg:deb/debian/curl@7.50.3-1?arch=i386&distro=jessie").toString()); + assertEquals("npm/npmjs/-/foobar/12.3.1", new PackageUrlIdParser().parseId("pkg:npm/foobar@12.3.1").toString()); assertEquals("maven/mavencentral/org.apache.xmlgraphics/batik-anim/1.9.1", - new PurlIdParser() + new PackageUrlIdParser() .parseId("pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?packaging=sources") .toString()); assertEquals("rpm/-/opensuse/curl/7.56.1-1.1.", - new PurlIdParser() + new PackageUrlIdParser() .parseId("pkg:rpm/opensuse/curl@7.56.1-1.1.?arch=i386&distro=opensuse-tumbleweed") .toString()); } @Test void testBasic2() { - assertNull(new PurlIdParser().parseId("@babel/highlight@7.5.0")); - assertNull(new PurlIdParser().parseId("highlight@7.5.0")); + assertNull(new PackageUrlIdParser().parseId("@babel/highlight@7.5.0")); + assertNull(new PackageUrlIdParser().parseId("highlight@7.5.0")); } }