Andrew Ducker (andrewducker) wrote,
Andrew Ducker
andrewducker

Anyone here know much about Java?

I have user input for a URL field. I want them to be able to enter anything from "http://andrewducker.wordpress.com/xmlrpc.php" to "andrewducker.wordpress.com" and be able to end up at the same end point.

I've wasted a couple of hours messing around with the various constructors for URL and not got to anywhere satisfactory, should I just do string checking and construct it myself?

I should make it clear - I always want the /xmlrpc.php bit to be what's on the end of the URL, that's a Wordpress standard, so I don't need to do any complex discovery. I just need to append that if it's not there.

I was hoping that someone would have written a class that could append bits of URLs together, but the basic stuff in the built in URL class doesn't quite cut it.



Original post on Dreamwidth - there are comment count unavailable comments there.
Subscribe

  • Interesting Links for 24-10-2021

    New Zealand trade deal is 'disgrace', says UK government climate adviser (tags: UK newzealand trade sheep environment ) White House delays…

  • Interesting Links for 23-10-2021

    Unite policy conference backs new voting system for UK general elections (tags: voting reform unions uk ) If Clouds Are Made of Water, How Do…

  • Interesting Links for 22-10-2021

    The NFT-based book-writing group aimed at teens that lasted nearly 12 hours before being questioned to death (tags: writing cryptography wtf…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 21 comments

  • Interesting Links for 24-10-2021

    New Zealand trade deal is 'disgrace', says UK government climate adviser (tags: UK newzealand trade sheep environment ) White House delays…

  • Interesting Links for 23-10-2021

    Unite policy conference backs new voting system for UK general elections (tags: voting reform unions uk ) If Clouds Are Made of Water, How Do…

  • Interesting Links for 22-10-2021

    The NFT-based book-writing group aimed at teens that lasted nearly 12 hours before being questioned to death (tags: writing cryptography wtf…