@Test public void testGuessfakeMimeRulesSourceMimeTypeFromPath() { MimeRulesSource source = new MimeRulesSource() { @Override public MimeRule getRuleForName(String path) { return new MimeRule(false, "foo/bar"); } }; assertThat(underTest.guessMimeTypeFromPath("/some/path/artifact.pom", source), equalTo("foo/bar")); }
@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);  }