Solved

image from url to file

Posted on 2014-02-04
8
292 Views
Last Modified: 2014-02-22
Hi,

I tried below example.

http://www.avajava.com/tutorials/lessons/how-do-i-save-an-image-from-a-url-to-a-file.html

When i run the example I do not see any output. How to fix this issue.

please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 19

Assisted Solution

by:Ken Butters
Ken Butters earned 125 total points
ID: 39834129
recreated example from your URL
http://www.avajava.com/tutorials/lessons/how-do-i-save-an-image-from-a-url-to-a-file.html

into a test java application

attached screenshot to show where jpg file is created and stored.
2-4-2014-4-36-45-PM.jpg
0
 
LVL 14

Assisted Solution

by:CPColin
CPColin earned 125 total points
ID: 39834131
Judging by the code, nothing is supposed to be printed to the console; the only output is to the image.jpg file. Have you searched around and tried to open that file?
0
 
LVL 7

Author Comment

by:gudii9
ID: 39843258
I do not see image.jpg.

Actully i see now below error

Exception in thread "main" java.net.ConnectException: Connection timed out: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)


I think i need to try from home laptop once i reach home instead. Not sure why Connection Timed out error coming.
SaveFromImg.jpg
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 19

Expert Comment

by:Ken Butters
ID: 39843286
Could be a firewall issue.

You may be blocked from : http://www.avajava.com/images/avajavalogo.jpg
0
 
LVL 35

Expert Comment

by:mccarl
ID: 39843945
Or possibly a proxy issue, if you can navigate to these sites from your browser ok but your Java apps fail then it is likely that you can only get to the Internet via a proxy. So yes, try from home and see how you go.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39878712
i tried from home laptop. I do not see jpg file being created. please advise
ImgFileJAva.jpg
0
 
LVL 14

Expert Comment

by:CPColin
ID: 39878744
Eclipse probably wouldn't show it immediately. Have you used the Search tool that Windows has to try to find image.jpg?
0
 
LVL 35

Accepted Solution

by:
mccarl earned 250 total points
ID: 39879144
I do not see jpg file being created
Right-click on your Project in Eclipse and select Refresh (or alternatively, select the project and hit F5) and then the file should show up. It will be towards the bottom of the list of files under you project, ie. it would be further down the screen than the part that you show in that screenshot.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Eclipse with gitlab 1 43
spring jars download 1 27
Unhandled exception type Exception 18 31
How do I remove an object from a 3 26
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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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…

778 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