Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
guperez
Posts: 37
Registered: 07-17-2008

Replacement for java.net Class URI

Guys,

 

It seems the the Class URI (http://java.sun.com/javase/6/docs/api/java/net/URI.html) is not present in the J2ME package. Does anyone know of a specific class that I could use to replace it? My main objective is to validate an URI and make sure I encode any invalid character (e.g. replace white spaces for %20) before I make my connections. I could do it manually but I was wondering if there is a Java or BlackBerry class that would do that for me.

 

Thanks,

 Gustavo

Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: 07-30-2008

Re: Replacement for java.net Class URI

I think the first thing I found for encoding is this but I was a little annoyed it didn't quite work the way I thought,

 

URLEncodedPostData

 

I think I grepped javadocs for urlencode and that was about the best I came up with. Not sure about validating

but for encoding that seems ok for encoding the query part of a URL. If you find something else let me know.

 

 

Please use plain text.