Re: Reading a file from another machine on the network
- From: "mineshdesai@xxxxxxxxx" <mineshdesai@xxxxxxxxx>
- Date: 14 Mar 2007 06:05:31 -0700
On Mar 14, 5:53 pm, Michael Rauscher <michlm...@xxxxxx> wrote:
mineshde...@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 athttp://jcifs.samba.org;)
Bye
Michael- Hide quoted text -
- Show quoted text -
Correct me if iam wrong...
I have to Map the shared folder on my system then use the drive name
give to the mapped folder in file constructor.
Secondly,
Shared folder is password protected, so now what should be done?
Thanks
Minesh
.
- Follow-Ups:
- 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
- Re: Reading a file from another machine on the network
- From: Michael Rauscher
- Reading a file from another machine on the network
- Prev by Date: Re: Reading a file from another machine on the network
- Next by Date: Re: Problem Clearing Cache?
- 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
|