aspose file tools*
The moose likes Java in General and the fly likes how to Transfer a file/jar to another Computer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to Transfer a file/jar to another Computer" Watch "how to Transfer a file/jar to another Computer" New topic
Author

how to Transfer a file/jar to another Computer

Dinesh Jayram
Greenhorn

Joined: Nov 26, 2008
Posts: 23
Is it possible to move a jar file to a network system without using client-server technology.

I am having a xyz.jar in my system, i want to pass this file to a system in local network. All computers
in the network are not shared. Guide me which package, framework i have to work to get it done

cheers
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Well, how would you do this not using Java? You need to figure out what underlying protocol you'er going to use, you can then choose a java package to assist you.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Dinesh Jayram
Greenhorn

Joined: Nov 26, 2008
Posts: 23
TCP/IP

normal network setup with 15 computers connected.

I tried java.io, it works when the drive or folder is shared.

I want to move the file without sharing any folder or drive
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hmm, Have you had a search on our FAQ sections for the FileUpload servlet?
Dinesh Jayram
Greenhorn

Joined: Nov 26, 2008
Posts: 23
I am looking for file transfer without client-server terminology
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Well then you need to do SCP or something similar, those things aren't done over TCP though.
Birla Murugesan
Ranch Hand

Joined: Nov 25, 2008
Posts: 66

well,As Martijn Verburg said,you have to go for scp command.
i think,the possibilty is less in framework level to move files to unshared system.
Anybody correct me,if i was wrong.
Dinesh Jayram
Greenhorn

Joined: Nov 26, 2008
Posts: 23
I am working with SCP.

One doubt Is SCP works fine in TCP environment?
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Have you read up on the SCP protocol? I suggest you google it, things will become a lot clearer then .
Dinesh Jayram
Greenhorn

Joined: Nov 26, 2008
Posts: 23
I am working on it, i have downloaded the "jsch-0.1.41" file and added to my project, and
trying to execute the programs in example folder. But still its not working.


As soon as i got executed the program i ll get back to you.

thank you Martijn.

Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
If you are planning something on the lines of automatic update, then you can even consider "Java Web Start" for the same.
Dinesh Jayram
Greenhorn

Joined: Nov 26, 2008
Posts: 23
Java Web Start is based on server-client technology. As far as i know in java web start, the client have to
click a link to get downloaded particular file. But I want the server system to send files to the client systems
using IP address.


Is it possible in JWS?
Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
Hmmm No.

But then, you mentioned you havent been having much of a luck with your SCP stuff, and hence I mentioned JWS.

"jsch" will open an SCP/SSH connection with your linux/unix boxes and you can internally use the SCP command to do the transfer. I dont understand what is stopping you from doing this. If you already tried it, and was not able to achieve the result, would you give me the stacktrace/logs anything so that we could get some pointers ?

Incase if you want to transfer your files to windows boxes, then just share a folder in the target machine, and do a normal filecopy using java, with the full network path of the target windows box, till the shared folder.
Dinesh Jayram
Greenhorn

Joined: Nov 26, 2008
Posts: 23
the primary constraint in my project is "The folder should not be shared."

Moreover i am using windows xp, Is there any command line commands to send file between two systems?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

FTP?

You can't just "send another computer a file" without the other computer being able to receive it some way, either by running a service, sharing a folder, etc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to Transfer a file/jar to another Computer