diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java index 377975f..72a5d34 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java @@ -208,6 +208,8 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt private WsTaskExecutorWidget taskExecutor = new WsTaskExecutorWidget(); public static final int delayTime = 3000; + + public static Map> mapOfAllowedMimeTypesForPreview = null; /** * Instantiates a new app controller explorer. @@ -2130,7 +2132,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt sub.loadFolder(loadFolderEvent.getTargetFolder()); } else if (event instanceof GetInfoEvent) { GetInfoEvent getInfoEvent = (GetInfoEvent) event; - sub.showDetails(getInfoEvent.getSourceFile()); + sub.showDetails(getInfoEvent.getSourceFile(), mapOfAllowedMimeTypesForPreview); } } @@ -2326,6 +2328,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt this.explorerPanel = new ExplorerPanel(true, true); loadMyLogin(); loadMyFirstName(); + loadAllowedMimeTypesForPreview(); return this.explorerPanel; } @@ -2347,9 +2350,12 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt this.selectRootItem = selectRootItem; loadMyLogin(); loadMyFirstName(); + loadAllowedMimeTypesForPreview(); return this.explorerPanel; } + + /** * Edi permissions. * @@ -2633,6 +2639,22 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt } }); } + + private void loadAllowedMimeTypesForPreview() { + + rpcWorkspaceService.getAllowedMimetypesForPreview(new AsyncCallback>>() { + + @Override + public void onFailure(Throwable caught) { + } + + @Override + public void onSuccess(Map> result) { + + mapOfAllowedMimeTypesForPreview = result; + } + }); + } /** * Load my first name. diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/interfaces/SubscriberInterface.java b/src/main/java/org/gcube/portlets/user/workspace/client/interfaces/SubscriberInterface.java index 414e660..b14bd92 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/interfaces/SubscriberInterface.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/interfaces/SubscriberInterface.java @@ -2,6 +2,7 @@ package org.gcube.portlets.user.workspace.client.interfaces; import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.gcube.portlets.user.workspace.client.ConstantsExplorer.ViewSwitchType; import org.gcube.portlets.user.workspace.client.ConstantsExplorer.WS_UPLOAD_TYPE; @@ -204,8 +205,9 @@ public interface SubscriberInterface { * Show details. * * @param fileModel the file model + * @param mapAllowedMimeTypesForPreview the map allowed mime types for preview */ - void showDetails(FileModel fileModel); + void showDetails(FileModel fileModel, Map> mapAllowedMimeTypesForPreview); } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java b/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java index 7e211ca..9c29f9d 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/resources/Icons.java @@ -418,7 +418,7 @@ public interface Icons extends ClientBundle { @Source("icons/sync-icon-synched.png") ImageResource syncIconSynched(); - @Source("icons/preview-not-available.png") + @Source("icons/no-preview-available.png") ImageResource previewNotAvailable(); } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/no-preview-available.png b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/no-preview-available.png new file mode 100644 index 0000000..9e324b0 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/no-preview-available.png differ diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/preview-not-available.png b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/preview-not-available.png index fe85c9e..ec57723 100644 Binary files a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/preview-not-available.png and b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/preview-not-available.png differ diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java index 0c7d432..a094c18 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java @@ -688,4 +688,11 @@ public interface GWTWorkspaceService extends RemoteService { */ String updateDescriptionForItem(String itemId, String newDescription) throws Exception; + /** + * Gets the allowed mimetypes for preview. + * + * @return the allowed mimetypes for preview + */ + Map> getAllowedMimetypesForPreview(); + } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java index 93f1296..2f236c4 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java @@ -622,5 +622,14 @@ public interface GWTWorkspaceServiceAsync { * @param callback the callback */ void updateDescriptionForItem(String itemId, String newDescription, AsyncCallback callback); + + + + /** + * Gets the allowed mimetypes for preview. + * + * @return the allowed mimetypes for preview + */ + void getAllowedMimetypesForPreview(AsyncCallback>> callback); } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java index ff4926d..3a5ae67 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java @@ -12,7 +12,6 @@ import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.Download import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum; import org.gcube.portlets.user.workspace.client.model.FileGridModel; import org.gcube.portlets.user.workspace.client.model.FileModel; -import org.gcube.portlets.user.workspace.client.resources.Icons; import org.gcube.portlets.user.workspace.client.resources.Resources; import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspaceItem; import org.gcube.portlets.user.workspace.client.workspace.folder.item.GWTExternalImage; @@ -52,6 +51,7 @@ import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.NamedFrame; import com.google.gwt.user.client.ui.Widget; +import com.google.gwt.user.server.Base64Utils; // TODO: Auto-generated Javadoc /** @@ -62,6 +62,8 @@ import com.google.gwt.user.client.ui.Widget; */ public class DialogGetInfoBootstrap extends Composite { + private static final int PREVIEW_WAITING_TIME = 10000; + private static DialogGetInfoBootstrapUiBinder uiBinder = GWT.create(DialogGetInfoBootstrapUiBinder.class); /** @@ -189,16 +191,24 @@ public class DialogGetInfoBootstrap extends Composite { private Long fileSize = null; + private Map> mapAllowedMimeTypesForPreview; + + private Image spinnerImage = Resources.getIconLoading().createImage(); + + private Image noPreviewAvailable = new Image(Resources.getPreviewNotAvailable()); + /** * Instantiates a new dialog get info bootstrap. * * @param fileModel the file model * @param onCloseCommand the on close command + * @param mapAllowedMimeTypesForPreview the map allowed mime types for preview */ - public DialogGetInfoBootstrap(final FileModel fileModel, final Command onCloseCommand) { + public DialogGetInfoBootstrap(final FileModel fileModel, final Command onCloseCommand, Map> mapAllowedMimeTypesForPreview) { initWidget(uiBinder.createAndBindUi(this)); this.fileModel = fileModel; this.onCloseCommand = onCloseCommand; + this.mapAllowedMimeTypesForPreview = mapAllowedMimeTypesForPreview; this.cgTxtMimeType.setVisible(true); buttonClose.getElement().getStyle().setFloat(Float.RIGHT); @@ -340,111 +350,93 @@ public class DialogGetInfoBootstrap extends Composite { // SOLUTION BASED ON GOOGLE DOC VIEWER - if (typeEnum.equals(GXTFolderItemTypeEnum.EXTERNAL_PDF_FILE) || - - typeEnum.equals(GXTFolderItemTypeEnum.PDF_DOCUMENT) - || typeEnum.equals(GXTFolderItemTypeEnum.EXTERNAL_FILE)) { - - AppControllerExplorer.rpcWorkspaceService.getPublicLinkForFileItemId(fileModel.getIdentifier(), false, - new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - } - - @Override - public void onSuccess(PublicLink result) { - - GWT.log("The PublicLink link is: " + result); - - if (result != null) { - - //if file size is null or greater than 25MB - long byteTo25MB = 1024*1024*25; - GWT.log("The file size is: "+fileSize); - if(fileSize==null || fileSize>byteTo25MB) { - GWT.log("The file size is null or greater than "+byteTo25MB+", returning"); - //htmlPanelFilePreview.add(new Image(Resources.getPreviewNotAvailable())); - return; - } - -// String pdfPreview = ""; - - String googleDocViewerURL = "https://docs.google.com/viewer?url=" - + URL.encode(result.getCompleteURL()) + "&embedded=true"; - - final HTML loadingPreviewHTML = new HTML(); - setPlaceholder(loadingPreviewHTML, "loading preview..."); - - final Frame frame = instanceFrame(googleDocViewerURL, loadingPreviewHTML); - - final long startTime = new Date().getTime(); - Timer timer = new Timer() { + if (typeEnum.equals(GXTFolderItemTypeEnum.EXTERNAL_PDF_FILE) + || typeEnum.equals(GXTFolderItemTypeEnum.PDF_DOCUMENT) + || typeEnum.equals(GXTFolderItemTypeEnum.EXTERNAL_FILE) + || typeEnum.equals(GXTFolderItemTypeEnum.GCUBE_ITEM) + || typeEnum.equals(GXTFolderItemTypeEnum.URL_DOCUMENT) + || typeEnum.equals(GXTFolderItemTypeEnum.METADATA)){ + + if(mapAllowedMimeTypesForPreview.containsKey(fileModel.getType())){ + GWT.log("Mime type "+fileModel.getType()+" allowed for preview, try to display it"); + + AppControllerExplorer.rpcWorkspaceService.getPublicLinkForFileItemId(fileModel.getIdentifier(), false, + new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + } + + @Override + public void onSuccess(PublicLink result) { + + GWT.log("The PublicLink link is: " + result); + + if (result != null) { - @Override - public void run() { - GWT.log("Checking if the iFrameGoogleDocViewer is ready"); - if(iFrameGoogleDocViewerLoaded) { - removePlaceHolder(loadingPreviewHTML); - GWT.log("iFrameGoogleDocViewer currently loaded, cancelling timer"); - cancel(); - return; - } - long checkTime = new Date().getTime(); - long diff = checkTime - startTime; - if(diff>5000) {//is greater than 5 sec - try { - GWT.log("iFrameGoogleDocViewer not loaded within 5 sec, cancelling timer, removing iframe"); - cancel(); + //if file size is null or greater than 25MB + long byteTo25MB = 1024*1024*25; + GWT.log("The file size is: "+fileSize); + if(fileSize==null || fileSize>byteTo25MB) { + GWT.log("The file size is null or greater than "+byteTo25MB+", returning"); + //htmlPanelFilePreview.add(new Image(Resources.getPreviewNotAvailable())); + return; + } + + // String pdfPreview = ""; + + String googleDocViewerURL = "https://docs.google.com/viewer?url=" + + URL.encode(result.getCompleteURL()) + "&embedded=true"; + + final HTML loadingPreviewHTML = new HTML(); + setPlaceholder(loadingPreviewHTML, true, "loading preview..."); + + final Frame frame = instanceFrame(googleDocViewerURL, loadingPreviewHTML); + + final long startTime = new Date().getTime(); + Timer timer = new Timer() { + + @Override + public void run() { + GWT.log("Checking if the iFrameGoogleDocViewer is ready"); + if(iFrameGoogleDocViewerLoaded) { removePlaceHolder(loadingPreviewHTML); - htmlPanelFilePreview.add(new Image(Resources.getPreviewNotAvailable())); - frame.setVisible(false); - htmlPanelFilePreview.remove(frame); - }catch (Exception e) { - //Silent + GWT.log("iFrameGoogleDocViewer currently loaded, cancelling timer"); + cancel(); + return; + } + long checkTime = new Date().getTime(); + long diff = checkTime - startTime; + if(diff>PREVIEW_WAITING_TIME) {//is greater than 10 sec + try { + GWT.log("iFrameGoogleDocViewer not loaded within 5 sec, cancelling timer, removing iframe"); + cancel(); + removePlaceHolder(loadingPreviewHTML); + htmlPanelFilePreview.add(noPreviewAvailable); + frame.setVisible(false); + htmlPanelFilePreview.remove(frame); + }catch (Exception e) { + //Silent + } } } - } - }; - timer.scheduleRepeating(200); - - htmlPanelFilePreview.add(loadingPreviewHTML); - htmlPanelFilePreview.add(frame); - htmlPanelFilePreview.setVisible(true); + }; + timer.scheduleRepeating(200); + + htmlPanelFilePreview.add(loadingPreviewHTML); + htmlPanelFilePreview.add(frame); + htmlPanelFilePreview.setVisible(true); + } } - } - }); + }); + }else { + GWT.log("Mime type "+fileModel.getType()+" NOT allowed for preview, displaying 'No preview available'"); + htmlPanelFilePreview.add(noPreviewAvailable); + htmlPanelFilePreview.setVisible(true); + } } - - //SOLUTION BASED ON PDFOBEJCT - /*if(typeEnum.equals(GXTFolderItemTypeEnum.EXTERNAL_PDF_FILE) || - typeEnum.equals(GXTFolderItemTypeEnum.PDF_DOCUMENT)) { - - GWT.log("The file is a PDF"); - - AppControllerExplorer.rpcWorkspaceService.getPublicLinkForFileItemId(fileModel.getIdentifier(), false, new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - } - - @Override - public void onSuccess(PublicLink result) { - - GWT.log("The PublicLink link is: "+result); - - if(result!=null) { - - String pdfPreview = "
"; - htmlPanelFilePreview.add(new HTML(pdfPreview)); - showPDFPreview(result.getCompleteURL(), "pdfPrewiewDiv"); - htmlPanelFilePreview.setVisible(true); - } - } - }); - }*/ } addHandlers(); @@ -602,7 +594,7 @@ public class DialogGetInfoBootstrap extends Composite { */ private void loadLocation(FileModel fileModel) { - setPlaceholder(txtLocation, "loading..."); + setPlaceholder(txtLocation, false, "loading..."); AppControllerExplorer.rpcWorkspaceService.getListParentsByItemIdentifier(fileModel.getIdentifier(), false, new AsyncCallback>() { @@ -641,7 +633,7 @@ public class DialogGetInfoBootstrap extends Composite { */ private void loadSize(final String itemId) { GWT.log("Load size"); - setPlaceholder(txtSize, "loading..."); + setPlaceholder(txtSize, false, "loading..."); fileSize = new Long(-1); //means is loading AppControllerExplorer.rpcWorkspaceService.loadSizeByItemId(itemId, new AsyncCallback() { @@ -673,7 +665,7 @@ public class DialogGetInfoBootstrap extends Composite { */ private void loadCreationDate(final String itemId) { - setPlaceholder(txtCreated, "loading..."); + setPlaceholder(txtCreated, false, "loading..."); AppControllerExplorer.rpcWorkspaceService.getItemCreationDateById(itemId, new AsyncCallback() { @Override @@ -701,7 +693,7 @@ public class DialogGetInfoBootstrap extends Composite { */ private void loadLastModificationDate(final String itemId) { - setPlaceholder(txtLastMofication, "loading..."); + setPlaceholder(txtLastMofication, false, "loading..."); AppControllerExplorer.rpcWorkspaceService.loadLastModificationDateById(itemId, new AsyncCallback() { @Override @@ -794,7 +786,7 @@ public class DialogGetInfoBootstrap extends Composite { */ private void loadACLsDescriptionForSharedFolder(String sharedId) { - setPlaceholder(txtSharedWith, "loading..."); + setPlaceholder(txtSharedWith, true, "loading..."); WorkspaceSharingServiceAsync.INSTANCE.getACLsDescriptionForSharedFolderId(sharedId, new AsyncCallback() { @@ -827,7 +819,7 @@ public class DialogGetInfoBootstrap extends Composite { htmlPanelImagePreview.setVisible(true); final HTML txtLoadingPreview = new HTML(); htmlPanelImagePreview.add(txtLoadingPreview); - setPlaceholder(txtLoadingPreview, "loading preview..."); + setPlaceholder(txtLoadingPreview, true, "loading preview..."); AppControllerExplorer.rpcWorkspaceService.getImageById(fileModel.getIdentifier(), fileModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.IMAGE_DOCUMENT), false, @@ -863,8 +855,12 @@ public class DialogGetInfoBootstrap extends Composite { * @param html the html * @param placeholder the placeholder */ - private void setPlaceholder(HTML html, String placeholder) { - html.setHTML(placeholder); + private void setPlaceholder(HTML html, boolean spinner, String placeholder) { + String loadingHMTL = placeholder; + if(spinner) { + loadingHMTL = ""+placeholder+""; + } + html.setHTML(loadingHMTL); html.getElement().addClassName("placeholder-loading"); } diff --git a/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css b/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css index f33298e..eb8e29e 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css +++ b/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css @@ -399,7 +399,7 @@ IN THE 'DETAILS' PANEL*/ } .placeholder-loading { - color: #E8E8E8; + color: rgb(142, 142, 142); } .shared-with-style{ diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java index 2ccf2a7..d71cd0a 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java @@ -53,6 +53,7 @@ import org.gcube.portlets.user.workspace.server.reader.ApplicationProfileReader; import org.gcube.portlets.user.workspace.server.tostoragehub.FormatterUtil; import org.gcube.portlets.user.workspace.server.tostoragehub.ObjectStorageHubToWorkpaceMapper; import org.gcube.portlets.user.workspace.server.tostoragehub.StorageHubToWorkpaceConverter; +import org.gcube.portlets.user.workspace.server.util.MimeTypeUtility; import org.gcube.portlets.user.workspace.server.util.PortalContextInfo; import org.gcube.portlets.user.workspace.server.util.StringUtil; import org.gcube.portlets.user.workspace.server.util.WsUtil; @@ -3077,6 +3078,14 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT } + /** + * Update description for item. + * + * @param itemId the item id + * @param newDescription the new description + * @return the string + * @throws Exception the exception + */ @Override public String updateDescriptionForItem(String itemId, String newDescription) throws Exception { workspaceLogger.info("Called updateDescriptionForItem for itemID: " + itemId); @@ -3101,4 +3110,24 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT return newDescription; } + + + /** + * Gets the allowed mimetypes for preview. + * + * @return the allowed mimetypes for preview + */ + + @Override + public Map> getAllowedMimetypesForPreview(){ + workspaceLogger.info("Called getAllowedMimetypesForPreview"); + + Map> map = MimeTypeUtility.getPreviewMimetypeExtensionMap(); + + workspaceLogger.debug("Returning allowed mimetypes for preview: "+map.keySet()); + + return map; + + } + } diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/util/MimeTypeUtility.java b/src/main/java/org/gcube/portlets/user/workspace/server/util/MimeTypeUtility.java index 454d9f7..16a72f8 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/util/MimeTypeUtility.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/util/MimeTypeUtility.java @@ -22,6 +22,7 @@ import org.apache.tika.mime.MediaType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +// TODO: Auto-generated Javadoc /** * The Class MimeTypeUtil. * @@ -48,15 +49,19 @@ public class MimeTypeUtility { protected static final Map> mimetype_extension_map = new LinkedHashMap>(); protected static final Map extension_mimetype_map = new LinkedHashMap(); + protected static final Map> preview_mimetype_extension_map = new LinkedHashMap>(); static { InputStream extensionToMimetype = MimeTypeUtility.class .getResourceAsStream("/WsExtensionToMimeTypeMap.properties"); InputStream mimetypeToExtension = MimeTypeUtility.class .getResourceAsStream("/WsMimeTypeToExtensionMap.properties"); + InputStream previewMimeTypeToExtension = MimeTypeUtility.class + .getResourceAsStream("/PreviewMimeTypeToExtensionMap.properties"); try { loadExtensions(extensionToMimetype); loadMimeTypes(mimetypeToExtension); + loadPreviewMimeTypes(previewMimeTypeToExtension); } catch (IOException e) { e.printStackTrace(); } @@ -114,6 +119,35 @@ public class MimeTypeUtility { } br.close(); } + + + /** + * Load preview mime types. + * + * @param is the is + * @throws IOException Signals that an I/O exception has occurred. + */ + protected static void loadPreviewMimeTypes(InputStream is) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + + String line = br.readLine(); + + while (line != null) { + String[] split = line.split("="); + if (split.length == 2) { + String mimeType = split[0]; + String extension = split[1]; + List toExtensions = preview_mimetype_extension_map.get(mimeType); + if (toExtensions == null) { + toExtensions = new ArrayList(); + } + toExtensions.add(extension); + preview_mimetype_extension_map.put(mimeType, toExtensions); + } + line = br.readLine(); + } + br.close(); + } /** * Gets the extension. @@ -279,5 +313,16 @@ public class MimeTypeUtility { public static Map getExtensionToMimeTypeMap() { return extension_mimetype_map; } + + + /** + * Gets the preview mimetype extension map with the + * mime types allowed for preview displaying + * + * @return the preview mimetype extension map + */ + public static Map> getPreviewMimetypeExtensionMap() { + return preview_mimetype_extension_map; + } } diff --git a/src/main/resources/PreviewMimeTypeToExtensionMap.properties b/src/main/resources/PreviewMimeTypeToExtensionMap.properties new file mode 100644 index 0000000..4f280e0 --- /dev/null +++ b/src/main/resources/PreviewMimeTypeToExtensionMap.properties @@ -0,0 +1,62 @@ +application/msword=doc +application/pdf=pdf +application/rtf=rtf +application/vnd.ms-excel=xls +application/vnd.ms-powerpoint=ppt +application/vnd.openxmlformats-officedocument.wordprocessingml.document=docx +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=xlsx +application/vnd.openxmlformats-officedocument.presentationml.presentation=pptx +application/x-javascript=js +application/json=json +audio/mid=mid +audio/mpeg=mp3 +audio/x-wav=wav +image/bmp=bmp +image/gif=gif +image/ief=ief +image/jpeg=jpe +image/jpeg=jpeg +image/jpeg=jpg +image/pipeg=jfif +image/svg+xml=svg +image/tiff=tif +image/tiff=tiff +image/x-cmu-raster=ras +image/x-cmx=cmx +image/x-icon=ico +image/x-rgb=rgb +text/css=css +text/html=htm +text/html=stm +text/html=html +text/plain=bas +text/plain=c +text/plain=h +text/plain=txt +text/richtext=rtx +text/scriptlet=sct +text/tab-separated-values=tsv +text/uri-list=txt +text/webviewhtml=htt +text/x-component=htc +video/mpeg=mp2 +video/mpeg=mpa +video/mpeg=mpe +video/mpeg=mpeg +video/mpeg=mpg +video/mpeg=mpv2 +video/quicktime=mov +video/quicktime=qt +video/x-la-asf=lsf +video/x-la-asf=lsx +video/x-ms-asf=asf +video/x-ms-asf=asr +video/x-ms-asf=asx +video/x-msvideo=avi +video/x-sgi-movie=movie +x-world/x-vrml=flr +x-world/x-vrml=vrml +x-world/x-vrml=wrl +x-world/x-vrml=wrz +x-world/x-vrml=xaf +x-world/x-vrml=xof \ No newline at end of file