Solved

InputStream from a URI?

Posted on 2009-07-12
3
1,687 Views
Last Modified: 2012-05-07
Hi,

I have a URI to a resource, which is reality represents a zip file on the web, and I want to read it using InputStream. Should I use Http classes?

Thank you.
0
Comment
Question by:kerzner
  • 2
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 300 total points
ID: 24836555
Use the URL class
0
 
LVL 92

Assisted Solution

by:objects
objects earned 300 total points
ID: 24836559
0
 
LVL 17

Assisted Solution

by:Thomas4019
Thomas4019 earned 200 total points
ID: 24836686
Here's how i would do it.
URI uri = .... ;

InputStream is = uri.toURL().openStream();

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Image decoding from Camera 3 72
Java Loop 6 49
how to add new optional parameter to JSP 1 29
use lov values 2 36
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now