List of usage examples for com.vaadin.util FileTypeResolver DEFAULT_ICON
Resource DEFAULT_ICON
To view the source code for com.vaadin.util FileTypeResolver DEFAULT_ICON.
Click Source Link
From source file:info.magnolia.filesystembrowser.app.imageprovider.FSImageProvider.java
License:Open Source License
@Override public Object getThumbnailResource(Object itemId, String generator) { if (itemId instanceof File) { File file = (File) itemId; if (file.exists()) { String mimeType = FileTypeResolver.getMIMEType(file); if (mimeType != null && mimeType.matches("image.*")) { Resource imageResource = scaleImage(file); return imageResource; } else { Resource resolvedThumbnail = FileTypeResolver.getIcon(file); return resolvedThumbnail == null ? FileTypeResolver.DEFAULT_ICON : resolvedThumbnail; }// w w w . j a v a 2s . c o m } } return null; }