@Test public void testGuessMimeTypeFromPath() { assertThat(underTest.guessMimeTypeFromPath("/some/path/artifact.pom"), equalTo("application/xml")); assertThat(underTest.guessMimeTypeFromPath("/some/path/artifact.jar"), equalTo("application/java-archive")); assertThat(underTest.guessMimeTypeFromPath("/some/path/artifact-sources.jar"), equalTo("application/java-archive")); assertThat(underTest.guessMimeTypeFromPath("/some/path/maven-metadata.xml"), equalTo("application/xml")); assertThat(underTest.guessMimeTypeFromPath("/some/path/some.xml"), equalTo("application/xml")); assertThat(underTest.guessMimeTypeFromPath("/some/path/some.tar.gz"), equalTo("application/x-gzip")); assertThat(underTest.guessMimeTypeFromPath("/some/path/some.tar.bz2"), equalTo("application/x-bzip2")); assertThat(underTest.guessMimeTypeFromPath("/some/path/some.zip"), equalTo("application/zip")); assertThat(underTest.guessMimeTypeFromPath("/some/path/some.war"), equalTo("application/java-archive")); assertThat(underTest.guessMimeTypeFromPath("/some/path/some.rar"), equalTo("application/java-archive")); assertThat(underTest.guessMimeTypeFromPath("/some/path/some.ear"), equalTo("application/java-archive")); assertThat(underTest.guessMimeTypeFromPath("/some/path/some.ejb"), equalTo("application/java-archive")); }
@Nonnull @Override public String guessMimeTypeFromPath(final String path, final MimeRulesSource... mimeRulesSources) { return guessMimeTypesListFromPath(path, mimeRulesSources).get(0); }
DefaultMimeSupport implements MimeSupport { @Nonnull @Override public String guessMimeTypeFromPath(final String path, final MimeRulesSource... mimeRulesSources) { return guessMimeTypesListFromPath(path, mimeRulesSources).get(0); } }
DefaultMimeSupport implements MimeSupport { @Nonnull @Override public String guessMimeTypeFromPath(final String path, final MimeRulesSource... mimeRulesSources) { return guessMimeTypesListFromPath(path, mimeRulesSources).get(0); } @Inject  DefaultMimeSupport(); @VisibleForTesting  DefaultMimeSupport(final NexusMimeTypes nexusMimeTypes); }
DefaultMimeSupport implements MimeSupport { @Nonnull @Override public String guessMimeTypeFromPath(final String path, final MimeRulesSource... mimeRulesSources) { return guessMimeTypesListFromPath(path, mimeRulesSources).get(0); } @Inject  DefaultMimeSupport(); @VisibleForTesting  DefaultMimeSupport(final NexusMimeTypes nexusMimeTypes); @Nonnull @Override String guessMimeTypeFromPath(final String path, final MimeRulesSource... mimeRulesSources); @Nonnull @Override List<String> guessMimeTypesListFromPath(final String path, final MimeRulesSource... mimeRulesSources); @Nonnull @Override String detectMimeType(final InputStream input, @Nullable final String fileName); @Nonnull @Override List<String> detectMimeTypes(final InputStream input, @Nullable final String fileName); }
DefaultMimeSupport implements MimeSupport { @Nonnull @Override public String guessMimeTypeFromPath(final String path, final MimeRulesSource... mimeRulesSources) { return guessMimeTypesListFromPath(path, mimeRulesSources).get(0); } @Inject  DefaultMimeSupport(); @VisibleForTesting  DefaultMimeSupport(final NexusMimeTypes nexusMimeTypes); @Nonnull @Override String guessMimeTypeFromPath(final String path, final MimeRulesSource... mimeRulesSources); @Nonnull @Override List<String> guessMimeTypesListFromPath(final String path, final MimeRulesSource... mimeRulesSources); @Nonnull @Override String detectMimeType(final InputStream input, @Nullable final String fileName); @Nonnull @Override List<String> detectMimeTypes(final InputStream input, @Nullable final String fileName);  }