|
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
|
Sie können einen Trackback für diesen Artikel hinterlassen, indem Sie diesen Trackback Link verwenden
|