File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Manage Network Files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Manage Network Files" Watch "Manage Network Files" New topic
Author

Manage Network Files

Luis Fernandes
Greenhorn

Joined: Sep 22, 2007
Posts: 19
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\\ )


Luis Claudio<br />MCSE ; CCNA ; SCJP 5.0
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19692
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Luis Fernandes
Greenhorn

Joined: Sep 22, 2007
Posts: 19
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

Joined: Oct 27, 2005
Posts: 19692
    
  20

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Manage Network Files