Updated Resource

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event@113635 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-03-17 17:44:13 +00:00
parent ff09c1b28f
commit ef48de7e4d
2 changed files with 64 additions and 9 deletions

View File

@ -7,6 +7,17 @@ package org.gcube.portlets.user.td.widgetcommonevent.shared.mime;
*
*/
public enum MimeTypeSupport {
_csv(".csv","text/csv"),
_jpg(".jpg","image/jpeg"),
_png(".png","image/png"),
_gif(".gif","image/gif"),
_bmp(".bmp","image/bmp"),
_json(".json","application/json"),
_txt(".txt", "text/plain"),
_pdf(".pdf", "application/pdf"),
_unknow(".unknow","unknow");
/*_3dm(".3dm","x-world/x-3dmf"),
_3dmf(".3dmf","x-world/x-3dmf"),
_a(".a","application/octet-stream"),
@ -15,13 +26,6 @@ public enum MimeTypeSupport {
_aas(".aas", "application/x-authorware-seg"),
_abc(".abc", "text/vnd.abc"),
_acgi(".acgi","text/html"),*/
_csv(".csv","text/csv"),
_jpg(".jpg","image/jpeg"),
_json(".json","application/json"),
_txt(".txt", "text/plain"),
_unknow(".unknow","unknow");
/*
.acgi text/html
@ -696,7 +700,7 @@ public enum MimeTypeSupport {
}
public MimeTypeSupport getMimeTypeSupportFromExtension(String ext){
public static MimeTypeSupport getMimeTypeSupportFromExtension(String ext){
for(MimeTypeSupport m:MimeTypeSupport.values()){
if(m.getExtension().compareTo(ext)==0){
return m;
@ -705,7 +709,7 @@ public enum MimeTypeSupport {
return null;
}
public MimeTypeSupport getMimeTypeSupportFromMimeName(String mimeName){
public static MimeTypeSupport getMimeTypeSupportFromMimeName(String mimeName){
for(MimeTypeSupport m:MimeTypeSupport.values()){
if(m.getMimeName().compareTo(mimeName)==0){
return m;

View File

@ -0,0 +1,51 @@
package org.gcube.portlets.user.td.widgetcommonevent.shared.thumbnail;
import java.io.Serializable;
import org.gcube.portlets.user.td.widgetcommonevent.shared.mime.MimeTypeSupport;
/**
* Thumbnail for Tabular Data Manager
*
* @author "Giancarlo Panichi"
*
*/
public class ThumbnailTD implements Serializable {
private static final long serialVersionUID = 897893891284145975L;
private String url;
private MimeTypeSupport mimeType;
public ThumbnailTD() {
}
public ThumbnailTD(String url, MimeTypeSupport mimeType) {
super();
this.url = url;
this.mimeType = mimeType;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public MimeTypeSupport getMimeType() {
return mimeType;
}
public void setMimeType(MimeTypeSupport mimeType) {
this.mimeType = mimeType;
}
@Override
public String toString() {
return "ThumbnailTD [url=" + url + ", mimeType=" + mimeType + "]";
}
}