Logo
Jan
21
2011
HowTo: URLEncode a field in Pentaho Data Integration (Kettle) PDF Drucken E-Mail
Geschrieben von: FabGuy   

I've been working with PDI (aka. Kettle) for some time and came across the need to URLEncode a link.

Here's how I did:

java
var url = new org.apache.commons.httpclient.URI(link).toString();
if(new org.apache.commons.httpclient.URI(link).getScheme() == null) {
url = 'http://'+url;
}

Just put this code in a JavaScript-Step - it will convert the link-field to an url-field which has been URL-Encoded. If you're missing the schema in your link it will be set to "http". It uses some Java-Code for that.

HowTo | PDI | Programmierung


blog comments powered by Disqusblog comments powered by Disqus
 
Sie können einen Trackback für diesen Artikel hinterlassen, indem Sie diesen Trackback Link verwenden
Keine Trackbacks
Trackbacks zur Verfügung gestellt von Trackback für JoomlaTrackback für Joomla

 Apr   12 Mai   Jun

MDMDFSS
   1  2  3  4  5  6
  7  8  910111213
14151617181920
21222324252627
28293031 

Bild