| | |
help me to read a file from another machine in the network.
![]() |
And how exactly is the target file shared on the network ?? FTP, HTTP ?? or just by SMB (Windows Sharing) ??
You need to divulge more details as to what exactly are you trying to achieve.
Also although I know its useless saying this but still read this essay and learn how to frame your questions on a forum like this, it is you who will benefit most because if you ask questions correctly or ask the correct questions, more people will feel like answering to your query.
You need to divulge more details as to what exactly are you trying to achieve.
Also although I know its useless saying this but still read this essay and learn how to frame your questions on a forum like this, it is you who will benefit most because if you ask questions correctly or ask the correct questions, more people will feel like answering to your query.
Last edited by stephen84s; Dec 13th, 2008 at 9:28 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
As mentioned above how is the file shared ? But more importantly whats this got to do with Java ? Please put your question in proper context so that we are able to understand and in turn help you better.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
•
•
Join Date: Jan 2008
Posts: 71
Reputation:
Solved Threads: 1
really Sorry .....and thanks for answering me....
I want to read an image from a machine in network using http...
Actually my need is to read the image from a system and to store this in another one
I know that it can be done only by setting the Url..
///verruckt24:::But more importantly whats this got to do with Java ?
I dont understand this...i want to access this from a java class
I want to read an image from a machine in network using http...
Actually my need is to read the image from a system and to store this in another one
I know that it can be done only by setting the Url..
///verruckt24:::But more importantly whats this got to do with Java ?
I dont understand this...i want to access this from a java class
•
•
•
•
Originally Posted by ajithraj
///verruckt24:::But more importantly whats this got to do with Java ?
I dont understand this...i want to access this from a java class
•
•
•
•
Originally Posted by ajithraj
I know that it can be done only by setting the Url..
Here is an example that deals with text files.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
To quote the Javadocs of URLConnection to which I had already linked to in the previous post :
So you need to first connect and then check whether the content is available.
•
•
•
•
1. The connection object is created by invoking the openConnection method on a URL.
2. The setup parameters and general request properties are manipulated.
3. The actual connection to the remote object is made, using the connect method.
4. The remote object becomes available. The header fields and the contents of the remote object can be accessed.
Last edited by stephen84s; Dec 15th, 2008 at 2:58 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
•
•
Join Date: Nov 2008
Posts: 33
Reputation:
Solved Threads: 2
java Syntax (Toggle Plain Text)
public void URLReader(){ try{ URL logic = new URL("http://your host name & port number/folder/"); BufferedReader in = new BufferedReader(new InputStreamReader(logic.openStream())); String inputLine; while ((inputLine = in.readLine()) != null) System.out.println(inputLine); in.close(); } catch (MalformedURLException e) { System.out.println ("Malformed URL= "+e); } catch (IOException e) { System.out.println ("IO Exception = "+e); } Albert }
Last edited by cscgal; Dec 15th, 2008 at 6:08 pm. Reason: Added code tags
![]() |
Other Threads in the Java Forum
- Previous Thread: a beginner in java needs help
- Next Thread: Intranet aplication
| Thread Tools | Search this Thread |
account android api applet application array arrays automation bidirectional binary birt bluetooth class classes client code columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors exception expand fractal game givemetehcodez graphics gui guidancer homework html ide image inetaddress inheritance integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux list loop map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program project property recursion ria scanner search server set sharepoint smart sms smsspam sort sourcelabs splash sql sqlite static string subclass support swing testautomation threads tree unlimited webservices windows






