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 02-03-2021

    A journalist, the N word, and the New York Times (tags: journalism racism ) Tomahawk Steakhouse staff told to loan the firm 10% or they could…

  • Interesting Links for 01-03-2021

    A Decades-Long Quest Reveals New Details of Antimatter (tags: physics ) Which character from Hieronymus Bosch's Garden of Earthly Delights are…

  • Interesting Links for 28-02-2021

    Single Covid case puts New Zealand's largest city Auckland back into lockdown (tags: pandemic newzealand ) Do you like it when things in your…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 21 comments

  • Interesting Links for 02-03-2021

    A journalist, the N word, and the New York Times (tags: journalism racism ) Tomahawk Steakhouse staff told to loan the firm 10% or they could…

  • Interesting Links for 01-03-2021

    A Decades-Long Quest Reveals New Details of Antimatter (tags: physics ) Which character from Hieronymus Bosch's Garden of Earthly Delights are…

  • Interesting Links for 28-02-2021

    Single Covid case puts New Zealand's largest city Auckland back into lockdown (tags: pandemic newzealand ) Do you like it when things in your…