class Maven2BrowseNodeGenerator extends ComponentPathBrowseNodeGenerator {

  @Override
  public List<BrowsePath> computeComponentPaths(final Asset asset) {
    checkNotNull(asset);

    Component component = asset.component().get(); // NOSONAR: caller guarantees this

    List<String> componentPath = pathToArtifactFolder(component);

    // Components representing different timed snapshots would normally share the same artifact folder
    // in the standard Maven layout, for example 1.0-SNAPSHOT. But we want components to have a unique
    // entry in the browse UI so we give them each a timestamped folder under the base version folder.

    // So a component path of .../1.0-SNAPSHOT/ becomes .../1.0-SNAPSHOT/1.0-20171107.223311-1/

    String version = component.version();
    if (!isBlank(version) && !version.equals(componentPath.get(componentPath.size() - 1))) {
      componentPath.add(version);
    }

    return fromPaths(componentPath, true);
  }

}