How can I set time-out while accessing a url using URL object?

Hi
I'm trying to get the content of a URL using the following code. How can I set timeout
(example, 10 secs), if the webserver takes a while to respond.?
BufferedReader inbuf=null;
URL url=null;
try {      
     String urlString="http://host-machine/sms/index.jsp";          
     url = new URL(urlString);
     inbuf = new BufferedReader(new InputStreamReader(url.openStream()));
     String inputLine;
     String LongString="";
while ( (inputLine=inbuf.readLine()) != null)
          LongString=LongString+inputLine;
          retString=LongString;          
          inbuf.close();
     catch (Exception e) {System.out.println(e)}
Thanks a lot for your kind help
Regards
Kandasamy

If you're using Java 5, see this thread (reply 10)
http://forum.java.sun.com/thread.jspa?forumID=31&threadID=576157

Similar Messages

  • How can I set up a guest access point with a Time Capsule and an Airport Extreme? I am using a Telus router with the Time Capsule used as a wireless access point (bridge mode). I don't want the guest access point to have access to my network.

    How can I set up a guest access point with a Time Capsule and an Airport Extreme? I am using a Telus router with the Time Capsule used as a wireless access point (bridge mode). I don't want the guest access point to have access to my network.

    The Guest Network function of the Time Capsule and AirPort Extreme cannot be enabled when the device is in Bridge Mode. Unfortunately, with another router...the Telus...upstream on your network, Bridge Mode is indicated as the correct setting for all other routers on the network.
    If you can replace the Telus gateway with a simple modem (that performs no routing functions), you should be able to configure either the Time Capsule or the AirPort Extreme....whichever is connected to the modem....to provide a Guest Network.

  • How can we set Admin rights to access all user mailboxes in IMAP server exchange 2010?

    Hi,
    IMAP is in exchange 2010..
    as per guide:
    http://technet.microsoft.com/en-us/library/jj200730%28v=exchg.150%29.aspx
    CSV Files for IMAP Migration Batches`
    Use super-user or administrator credentials.   This requires that you use an account in your IMAP messaging system that has the necessary rights to access all user mailboxes.
    In the CSV file, you use the credentials for this account for each row. To learn whether your IMAP server supports this approach and how to enable it, see the documentation for your IMAP server.
    How can we set Admin rights to access all user mailboxes in IMAP server exchange 2010?
    thanks?

    Hi,
    Do you mean assigning a user full access permission to all other mailboxes? If so, we can try the following command:
    Get-Mailbox -Server “Exchange 2010” | Add-MailboxPermission -User AdminUserName -AccessRights FullAccess
    Thanks,
    Winnie Liang
    TechNet Community Support

  • How can you build time series measures in OBIEE without using TODATE AGO fu

    How can you build time series measures in OBIEE without using TODATE and AGO function?
    Please provide steps to build time series
    measures in OBIEE without using TODATE and
    AGO function. Dashboard results not storing
    in cache when using TODATE and AGO functions.
    eventhough its cached users queries not
    hitting cache because queries doesn't match
    exact date time when using TODATE and AGO
    functions. so I want to build queries using
    sysdate and some simple calculations. Please
    send your inputs/ideas for my questions..
    Thanks in Advance

    This can be using Msum function in answers. Use the following formula, here dollars is my metric. Change the formula based on your metric.
    Msum("Sales Measures".Dollars ,2) - "Sales Measures".Dollars
    the report will be cached and better performed compared with time series. check ti
    - Madan Thota

  • How can I set up iCloud sync with Outlook 2007 using Hotmail account?

    Hi,
    I installed iCloud PC control panel. I tried to sync my contacts and calendars from Outlook (2007) to the cloud but I gets this message: "Add an e-mail account to Outlook Before setting up iCloud". I have an Hotmail account synced up into my Outlook via Outlook Connector. Can iCloud sync with Hotmail accounts?
    What should I do to get my calendars and contacts synchronize to the cloud. Does Outlook 2007 can be synced by the cloud too?
    How can I set up iCloud sync with Outlook 2007 using Hotmail account?

    I found a way to fix this, it did the trick for me:
    https://discussions.apple.com/thread/3109623
    All you have to do is include a new e-mail account [email protected] (set it as a default) on Outlook with the options that are showed in the thread I linked and you should have the calendars and tasks syncronised. It works perfectly with ipod touch, ipad and Outlook 2010 on windows 7.

  • How can I set times to receive emails?

    Hi, can anyone tell me how I can set times on my iphone 4s when I do not want to receive emails?

    You can not do so other than by manually disabling the accounts when you do not want to get e-mail or changing the polling method to manual.

  • I have  20 ipads to hand out to teachers, all of them are using the same apps (purchased), I'm using 1 computer to configure them, I purchased 20 gift cards to purchase apps, how can I set up all 20 on one library using the gift cards to purchase the apps

    My office purchased 20 ipads - and 20 gift cards, I'm setting up all the software on my computer using 1 itunes library.. I need to purchase 20 of the same apps to put on each of the ipads... how can that be done when you purchase the same app..itunes tells you that you the app is already purchased...

    Another member pointed me toward the following site...it contains some great info...it's focus is on the use of iPad's in education....
    http://ipadeducators.ning.com/
    There is some discussion in there of device "cloning"..though I don't see how they can do that and at least not technically violate the iTunes Store EULA....(1 license can be used by 1 person on multiple devices, or by many people on one device).  As I understand it, and as Michael indicated, the only way to do what you want and not violate the EULA is to have 20 different Apple ID's...what the "cloner's"  have chosen to do is use the Educational VPP  www.apple.com/itunes/education
    purchase sufficient licenses for all users, allocate a license to one Apple ID, clone that image to other iOS devices, and simply record the fact internally that the additional  license(s) have been allocated to other Apple ID's....I work in healthcare, and our legal department isn't comfortable with that approach, and I can't see it really being legally viable in education....unless their are different terms for educational institutions....

  • Why my atv can't set time and date after restoring it using itunes ?

    when my atv restarting after  I restored it using iTunes, it can't set the time and date.
    the atv is connected to the net by wi - fi.
    when I try to sign in using my apple id, I get a massage that the password is incorrect.
    I have apple tv with ios 7.

    The network and signal test on device won't give the full picture, for that you need a network report. Go to istumbler, netstumbler or similar, that will show true signal strength as well as any nose detected. You can also try Ethernet to help rule out WiFi issues.

  • How can I set password for email access to prevent other from reading my mails?

    If i go to settings and erase my password that wont work. What can I do?

    Either access it via web mail only where you'll have to enter user name and password every time, or put the passcode lock on your ipad itself, locking down the whole device

  • How can I set descriptive filename while taking screenshot?

    When taking a series of screenshots (for instance when documenting the use of a web app), I'd like to be able to set a meaningful filename while I capture the image, rather than end up with a lot of timestamped image files in my Screenshots folder, which then need to be examined and relabeled.
    Is there a way in OS X using Cmd-Shift-4 (or a paid app) that allows me to enter a filename during the screenshot-capture workflow?
    Thanks.

    None that I'm aware of. See https://discussions.apple.com/message/22268462#22268462 for details on how names are assigned.

  • How can I set time signature for my song?

    I wanted to compose a song in Garageband in a time signature 3/4. I couldn't see any setting which lets me set it. Also I wanted to know what all time signatures do Garage Band support ?E.g. 2/3/, 4/4, 6/8,7/8 ...Would really appriciate if someone can help.

    As far as I'm aware GarageBand for iPad only supports 4/4 time, at least in it's present form.
    tt2

  • HT202157 How can I set time and date in the Apple TV???  This step doesn't let me go on with installing itunes!

    The area is set for San Juan, PR, but it doesn't recognize the date and time.

    This indicates a network issue.  Ensure DNS settings are set to Automatic and the regional settings are correct.

  • How can I set a default save file for scans using the Solution Center?

    Using Windows 7 - 64 bit.   HP Photosmart Premuim C-309a All-In-One Printer.
    Because of a Windows crash, I had to install a new drive and reload Windows. I also reloaded other software like the HP Solution Center & Drivers. My problem is that I can't find how to set a default folder for my scans.  This is NOT mentioned in the user manual but it was originally accomplished by HP Tech Support when the printer was new.  Can anyone relate how to set default folders for my scans?
    Thanks.
    Tango
    This question was solved.
    View Solution.

    Here is a document on how to scan through Windows 7. 
    http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&docname=c03476857
    Click either solution center or the icon of the printer on your desktop. Here select "Scanner Actions" (or the analogous selection). When the window pops up from the HP software it should provide you with options for file type (.tiff, .pdf, .jpg) as well as resolution and media size. Here on this page there is also an option for you to go to the advanced options. Using this you can alter the default safe folder. 
    Let me know if that helps you out! 

  • How Can I connect to a Microsoft Access Database without using LiveCycle?

    I have Acrobat Professional X. And I need to read a Microsoft Access Database. I don't have LiveCycle Form. Is there any way that I can connect to my database?

    You are in the wrong forum, mate. This is a forum for ColdFusion.

  • How can I set up different profiles (accounts??) using the credit card?

    Each member of my family would like to have there own itunes profile (or account??), but we'd like to use the same credit card. Is this possible? Does each family member need a unique email address for log in.
    Thanks
    Markoman

    So my sister and I have our own separate iTunes accounts, and she has her set up with her credit card. She let me use her credit card on mine but it keeps saying the security code is invalid. Then the credit card company called about her credit card activity. Are you sure it's not impossible to use the same credit card on our different accounts?

Maybe you are looking for

  • Does anyone know anything about servlets and multipart posting?

    im not getting much response on the servlet forum :( http://forum.java.sun.com/thread.jspa?threadID=701292&tstart=0 (i'll link back to here too)

  • ADDRESS ENDADDRESS command in SAPScript

    Hi Gurus, How does address endaddress command works in SAPscript. I want to use it in SAPscript as ADDRESS     ADDRESSNUMBER <LFA1-ADRNR>     FROMCOUNTRY 'US' ENDADDRESS. I have gone through the documentation of ADDRESS_INTO_PRINTFORM but still not c

  • Reversing with swing? Help!

    Alright, before you guys flip out and say post it to the swing forum, why does the swing forum say read only? Now I have searched the forum but cannot find anything that deals with swing and the kind I am doing. So if you can provide some advice or s

  • DMVPN Default routes (over internet and over tunnel)

    Hello all, I want to implement a DMVPN (using OSPF) solution in which all routers are connected to the internet and all of then have dynamic IP addresses (except hub). Because of this each router have a default gateway pointing to the ISP IP address.

  • Best Solution For Automatic Cache Refresh

    Hello SDN,         I need to know the best solution for automatic cahe update so that we donot get a runtime cache error in SXI_CACHE.We scheduled SAI_CACHE_REFRESH After every 1 minute, But is it the best solution??? We need to know if there are bet