Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-resources-widget@115589 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-06-26 14:04:47 +00:00
parent 1cf14f95ad
commit 6f1a439d4f
1 changed files with 26 additions and 0 deletions

View File

@ -928,12 +928,38 @@ public class ResourcesListViewPanel extends FramedPanel {
InternalURITD genericFileResourceTD = (InternalURITD) resource;
String name = resourceTDDescriptor.getName();
/*
MimeTypeSupport ext=null;
String extentionInName=null;
if(name!=null){
List<String> nameS=null;
try{
nameS=Arrays.asList(name.split("\\.(?=[^\\.]+$)"));
} catch(Throwable e) {
Log.error("No valid name for resource: "+name);
}
if(nameS!=null&&nameS.size()>1){
extentionInName=nameS.get(nameS.size()-1);
ext=MimeTypeSupport.getMimeTypeSupportFromExtension("."+extentionInName);
}
}
if(ext==null){
*/
MimeTypeSupport mts = MimeTypeSupport
.getMimeTypeSupportFromMimeName(genericFileResourceTD
.getMimeType());
if (mts != null) {
name = name + mts.getExtension();
}
/*
}
*/
UriResolverSession uriResolverSession = new UriResolverSession(
genericFileResourceTD.getId(), ApplicationType.SMP_ID,