Minor updated
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-import-widget@84276 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
6d1d424c2f
commit
91fd1587ed
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
package org.gcube.portlets.user.td.csvimportwidget.client;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.td.csvimportwidget.client.general.WizardCard;
|
||||
import org.gcube.portlets.user.td.csvimportwidget.client.progress.FileUploadProgressBarUpdater;
|
||||
|
@ -98,8 +98,16 @@ public class FileUploadPanel extends FormPanel {
|
|||
public void onChange(ChangeEvent event) {
|
||||
uploadButton.setEnabled(fileUploadField.isValid());
|
||||
String filename=fileUploadField.getValue();
|
||||
java.io.File file=new File(filename);
|
||||
importSession.setLocalFileName(file.getName());
|
||||
int punto=filename.lastIndexOf(".");
|
||||
int slash=filename.lastIndexOf("/");
|
||||
int backslash=filename.lastIndexOf("\\");
|
||||
if(slash>backslash){
|
||||
filename=filename.substring(slash, punto);
|
||||
} else {
|
||||
filename=filename.substring(backslash, punto);
|
||||
}
|
||||
|
||||
importSession.setLocalFileName(filename);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue