Re: Reading a file from another machine on the network
- From: Michael Rauscher <michlmann@xxxxxx>
- Date: Wed, 14 Mar 2007 13:53:21 +0100
mineshdesai@xxxxxxxxx schrieb:
On Mar 14, 4:14 pm, Michael Rauscher <michlm...@xxxxxx> wrote:mineshde...@xxxxxxxxx schrieb:
Hello,Which protocol?
I have a requirement in which i want to read a file from another
machine in the network. And also the machine is password protected.
Can any one help me out in this.Seems like the above is treated as UNC name which can't be used accross
I tried doing it in following way,
URI uri = URI.create("file://9.182.198.145/shared");
File file = new File(uri);
As i excute this code i get an exception as:
java.lang.IllegalArgumentException: URI has an authority component
platforms. E. g. Linux would look for a file 'shared' in directory
'9.182.198.145'.
Under windows you might want to try
"file://username:passw...@xxxxxxxxxxxxx/shared"
but perhaps it's easier to mount the share via
net use X: \\9.182.198.145\Shared <password> /user:<username>
and then access the file via X: ;)
Bye
Michael
Michael Thanks for reply,
I will explain you the requirement,
I have few machines on the network, i want to access a file under
"shared" folder on the machine with i.p address as 9.182.198.145
and all the systems have windows OS.
One more thing i tried with following code and i got the same
exception
Sorry, I was wrong.
Either you've got access to the Share, then you can simply use the UNC name (\\9.182.198.145\Shared). Otherwise I thinkg you'd have to map the Share to a drive letter or to have a look at http://jcifs.samba.org ;)
Bye
Michael
.
- Follow-Ups:
- Re: Reading a file from another machine on the network
- From: mineshdesai@xxxxxxxxx
- Re: Reading a file from another machine on the network
- References:
- Reading a file from another machine on the network
- From: mineshdesai@xxxxxxxxx
- Re: Reading a file from another machine on the network
- From: Michael Rauscher
- Re: Reading a file from another machine on the network
- From: mineshdesai@xxxxxxxxx
- Reading a file from another machine on the network
- Prev by Date: SOAP Help please
- Next by Date: Re: Reading a file from another machine on the network
- Previous by thread: Re: Reading a file from another machine on the network
- Next by thread: Re: Reading a file from another machine on the network
- Index(es):
Relevant Pages
|