@Test public void extractTarballName() { assertThat(NpmMetadataUtils.extractTarballName("somename.tgz"), equalTo("somename.tgz")); assertThat(NpmMetadataUtils.extractTarballName("package/-/tarball.tgz"), equalTo("tarball.tgz")); assertThat(NpmMetadataUtils.extractTarballName("@scope/package/-/tarball.tgz"), equalTo("tarball.tgz")); assertThat(NpmMetadataUtils.extractTarballName( "http: equalTo("simple-npm-package-2.0.1.tgz")); assertThat(NpmMetadataUtils.extractTarballName( "http: equalTo("simple-npm-package-2.0.1.tgz")); }
@Nonnull public static String extractTarballName(final String tarballUrl) { int idx = tarballUrl.lastIndexOf('/'); if (idx != -1) { return tarballUrl.substring(idx + 1); } else { return tarballUrl; } }
NpmMetadataUtils { @Nonnull public static String extractTarballName(final String tarballUrl) { int idx = tarballUrl.lastIndexOf('/'); if (idx != -1) { return tarballUrl.substring(idx + 1); } else { return tarballUrl; } } }
NpmMetadataUtils { @Nonnull public static String extractTarballName(final String tarballUrl) { int idx = tarballUrl.lastIndexOf('/'); if (idx != -1) { return tarballUrl.substring(idx + 1); } else { return tarballUrl; } } private  NpmMetadataUtils(); }
NpmMetadataUtils { @Nonnull public static String extractTarballName(final String tarballUrl) { int idx = tarballUrl.lastIndexOf('/'); if (idx != -1) { return tarballUrl.substring(idx + 1); } else { return tarballUrl; } } private  NpmMetadataUtils(); @Nonnull static String extractTarballName(final String tarballUrl); @Nullable static String extractTarballName(final NestedAttributesMap packageMetadata); @Nullable static NestedAttributesMap selectVersionByTarballName(
      final NestedAttributesMap packageRoot,
      final String tarballName); static DateTime maintainTime(final NestedAttributesMap packageRoot); @Nullable static DateTime lastModified(final NestedAttributesMap packageRoot); static void rewriteTarballUrl(final String repositoryName, final NestedAttributesMap packageRoot); static String createRepositoryPath(final String name, final String version); static String createTarballName(final String name, final String version); @Nonnull static NestedAttributesMap shrink(final NestedAttributesMap packageRoot); @Nonnull static NestedAttributesMap overlay(final NestedAttributesMap recessive, final NestedAttributesMap dominant); @Nonnull static NestedAttributesMap merge(final String key, final List<NestedAttributesMap> packages); static NestedAttributesMap mergeContents(final List<Content> contents); static NestedAttributesMap parseContent(final Content content); static Map<String, Object> overlay(
      final Map<String, Object> recessive,
      final Map<String, Object> dominant,
      final boolean mergeVersionDocuments); static String getLatestVersionFromPackageRoot(final NestedAttributesMap pkg); static NestedAttributesMap retrievePackageRoot(
      final NpmPackageId packageId,
      final Context context,
      final Repository repository); static List<String> findCachedVersionsRemovedFromRemote(
      final NestedAttributesMap cachedRoot,
      final NestedAttributesMap newPackageRoot,
      final BiFunction<NpmPackageId, String, Boolean> componentExists); static NestedAttributesMap mergePackageRoots(
      final NestedAttributesMap newPackageRoot,
      final NestedAttributesMap existingPackageRoot, final List<String> cachedVersions); static void removeVersionsNotCachedAndNotInNewRoot(final NestedAttributesMap newPackageRoot,
                                                             final NestedAttributesMap existingPackageRoot,
                                                             final List<String> cachedVersions); }
NpmMetadataUtils { @Nonnull public static String extractTarballName(final String tarballUrl) { int idx = tarballUrl.lastIndexOf('/'); if (idx != -1) { return tarballUrl.substring(idx + 1); } else { return tarballUrl; } } private  NpmMetadataUtils(); @Nonnull static String extractTarballName(final String tarballUrl); @Nullable static String extractTarballName(final NestedAttributesMap packageMetadata); @Nullable static NestedAttributesMap selectVersionByTarballName(
      final NestedAttributesMap packageRoot,
      final String tarballName); static DateTime maintainTime(final NestedAttributesMap packageRoot); @Nullable static DateTime lastModified(final NestedAttributesMap packageRoot); static void rewriteTarballUrl(final String repositoryName, final NestedAttributesMap packageRoot); static String createRepositoryPath(final String name, final String version); static String createTarballName(final String name, final String version); @Nonnull static NestedAttributesMap shrink(final NestedAttributesMap packageRoot); @Nonnull static NestedAttributesMap overlay(final NestedAttributesMap recessive, final NestedAttributesMap dominant); @Nonnull static NestedAttributesMap merge(final String key, final List<NestedAttributesMap> packages); static NestedAttributesMap mergeContents(final List<Content> contents); static NestedAttributesMap parseContent(final Content content); static Map<String, Object> overlay(
      final Map<String, Object> recessive,
      final Map<String, Object> dominant,
      final boolean mergeVersionDocuments); static String getLatestVersionFromPackageRoot(final NestedAttributesMap pkg); static NestedAttributesMap retrievePackageRoot(
      final NpmPackageId packageId,
      final Context context,
      final Repository repository); static List<String> findCachedVersionsRemovedFromRemote(
      final NestedAttributesMap cachedRoot,
      final NestedAttributesMap newPackageRoot,
      final BiFunction<NpmPackageId, String, Boolean> componentExists); static NestedAttributesMap mergePackageRoots(
      final NestedAttributesMap newPackageRoot,
      final NestedAttributesMap existingPackageRoot, final List<String> cachedVersions); static void removeVersionsNotCachedAndNotInNewRoot(final NestedAttributesMap newPackageRoot,
                                                             final NestedAttributesMap existingPackageRoot,
                                                             final List<String> cachedVersions); @VisibleForTesting
  static final DateTimeFormatter NPM_TIMESTAMP_FORMAT; static final String NAME; static final String DIST_TAGS; static final String VERSIONS; static final String VERSION; static final String DEPRECATED; static final String TIME; static final String DIST; static final String TARBALL; static final String META_ID; static final String META_REV; static final String META_UPDATED; }