Java API has URL parsing ability?

T

taras.di

Hi all,

I was wondering if any Java API gurus out there know of any methods
that Java provides that parses a relative path in a URL - that is, it
removes all of the escape characters and replaces it with the proper
characters. I've looked at java.net.URI, but it seems to me that you
need to construct a URI in order to use the getPath() method - I
already have a get path method: I just need to parse the relative path.

Thanks in advance

Taras
 
S

Stefan Schulz

Hi all,

I was wondering if any Java API gurus out there know of any methods
that Java provides that parses a relative path in a URL - that is, it
removes all of the escape characters and replaces it with the proper
characters. I've looked at java.net.URI, but it seems to me that you
need to construct a URI in order to use the getPath() method - I
already have a get path method: I just need to parse the relative path.

Assuming you mean you have a relative path to a file, look into file://
type URLs, they should, together with absolute paths, solve your problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top