Skip to content

Normalisation for whitelistPathsNonRecursive #425

@richard-melvin

Description

@richard-melvin

Calling this function with app-data/templates/uml works to find the resource files , but with app-data/templates/uml/ doesn't.

The verbose log reports:

INFO: 2020-05-01T13:58:43.893+0100	ClassGraph	ClassGraph version 4.8.77
2020-05-01T13:58:43.894+0100	ClassGraph	Operating system: Windows 10 10.0 amd64
2020-05-01T13:58:43.894+0100	ClassGraph	Java version: 11.0.2 / 11.0.2+9 (Oracle Corporation)
2020-05-01T13:58:43.894+0100	ClassGraph	Java home: C:\Program Files\OpenJDK\jdk-11.0.2
2020-05-01T13:58:43.900+0100	ClassGraph	ScanSpec:
2020-05-01T13:58:43.900+0100	ClassGraph	-- packageWhiteBlackList: whitelist: ["app-data.templates.uml."]; whitelistPrefixes: ["", "/", "app-data.", "app-data.templates.", "app-data.templates.uml."]
2020-05-01T13:58:43.901+0100	ClassGraph	-- packagePrefixWhiteBlackList: 
2020-05-01T13:58:43.901+0100	ClassGraph	-- pathWhiteBlackList: whitelist: ["app-data/templates/uml//"]; whitelistPrefixes: ["", "/", "app-data/", "app-data/templates/", "app-data/templates/uml/"]

Code fragment:

    assert !dirPath.startsWith("/");
    assert !dirPath.endsWith("/");

    try (ScanResult scanResult =
      new ClassGraph().verbose().whitelistPathsNonRecursive(dirPath + "/").scan())
    {

This finds nothing; omitting the `+ "/"` works.```


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions