public void upload(File file, String directory, String remoteFile, GSSCredential credential){
try {
GridFTPClient gridFTPClient = new GridFTPClient("", 9393);
gridFTPClient.authenticate(credential);
DataSource source = new DataSourceStream(new FileInputStream(file));
if(null != directory){
gridFTPClient.changeDir(directory);
}
gridFTPClient.extendedPut(remoteFile, source, this);
} catch (ServerException e) {