Reputation: 83
I was able to implement moving files from one directory to other in the same system using JAVA URL Connection.But I have to move files from a directory of one server to another(linux or windows) , and I should not use the third party Java APIs. Is there a way how to implement this? If yes , what configuration details are required in the program.please let me know how to implement it.
Upvotes: 0
Views: 1146
Reputation: 6158
What about writing a very small script like below..
SOURCEDIR=/home/subodhr/e_books/
DESTDIR=user@server:home/subodhr/Destination/
rsync -avh --exclude="*.bak" $SOURCEDIR $DESTDIR
save this file using .sh
extension
like moveFile.sh
then execute the script as ./moveFile.sh
Upvotes: 1
Reputation: 4202
Read the contents into serializable objects and pass them across different machines. Once received, just write them to the disk. You should be able to do this using core Java API.
Upvotes: 0