@Test public void useNexusMimeTypes() { this.underTest = new DefaultMimeSupport(mimeTypes); when(mimeTypes.getMimeRuleForExtension("test")).thenReturn(mimeType); when(mimeType.getMimetypes()).thenReturn(Lists.newArrayList("fake/mimetype")); assertThat(underTest.guessMimeTypeFromPath("foo.test"), is("fake/mimetype")); }
@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);  }