Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

InputStream from a URI?

Posted on 2009-07-12
3
Medium Priority
?
1,716 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 1200 total points
ID: 24836555
Use the URL class
0
 
LVL 92

Assisted Solution

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

Assisted Solution

by:Thomas4019
Thomas4019 earned 800 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

927 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