Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Manage Network Files

 
Luis Fernandes
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Its possyble to copy a file that are in a network location to my computer (C:\)

If yes :

Can someone give me a example in how to open a file that are in a network location, inside my network( For example : \\192.168.200.1\\Clients\\Luis.xls ).

And how to move a file that are in a location to another ( For example : move \\192.168.200.1\\Clients\\Luis.xls to \\192.168.300.3\\Advanced_Clients\\ )
 
Rob Spoor
Sheriff
Pie
Posts: 20492
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the OS supports it (so in Linux you need to have samba installed, for instance), you can just use regular files:

Just remember to escape all backslashes. You only need the double backslashes (so 4 in Java code) at the start.
 
Luis Fernandes
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my envoirenment is microsft. its not necessary provide any user and password to access in this files ?

can i replace the network file to a local folder in my machine ?
 
Rob Spoor
Sheriff
Pie
Posts: 20492
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah right, authentication... I haven't really tried it if you need to logon to the share separately. You need to look into the authentication processes of Java.

As for replacing, basically, if you have access to the drive, you can move and copy to it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic