C/S File Transfer CLI
2015-09-11 15:14
295 查看
Introduction
This project is designed for the user who like using ubuntu command line to communicate with the server.Environment
NetBeanJava 8 oracle
MongoDB
After you prepare all things above, just download this project or use the git clone it to your local disk.Do not forget to download the server end program along with it.
How to ?
open two terminalsrun the jar file under /projectdir/dist/FileTransferServer.jar
run the FileTransferClient.jar in the other terminal.
Description
While as we know, there are several differences between the CLI and the Swing version.Here we just talk about the CLI client.
The CLI version is designed to transfer the content in the .xls or .xlsx file to the server, then the server program will save the data in the MongoDB database.
look at the sample table from the sync .xls file:
name | sex | age | salary | location | intrest | self-intro | picture |
---|---|---|---|---|---|---|---|
John | male | 23 | 2000 | America | soccer | John.txt | John.jpg |
Lucy | female | 20 | 3500 | Englend | piano | Lucy.txt | Lucy.jpg |
Before you get the person file, you should look at the source code and find the database and collections where the file saved and indexed.
Every time you want to transfer the data to the database, you just add the items in the .xls or .xlsx file in the /FileTransferClientCLI/FileList directory, and place the .txt and .jpg file in the /FileTransferClientCLI/FileDirectory directory.Finally just start the server first and start the client, the file will automatically transferred to the server, you can open several client at the same time because the server keep multi-thread work.
Run Details
I. in a terminal find the server jar file, typejava -jar FileTransferServerCLI.jar port [multi-client-mode] # the port is mandated, you can't ignore them. # the multi client flag is optional, if you want to use multi client just set the # flag with true, like: java -jar .jar 8888 true
II. in another terminal find the client and run the jar file,
java -jar FileTransferClientCLI.jar ip port # here the ip and port number is mandated. # the ip is the server ip when you open your server the ip will show in the window # Actually if you run two program in the same machine, the ip is same with your # local machine.
Tips
If you want to use this code in your own project please keep the author in your code.No manners, No success.see source code at GitHub.
Contact
Email: 294101042@qq.comQQ: 294101042
相关文章推荐
- Ubuntu 默认壁纸历代记
- Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
- java对世界各个时区(TimeZone)的通用转换处理方法(转载)
- java-注解annotation
- java-模拟tomcat服务器
- java-用HttpURLConnection发送Http请求.
- java-WEB中的监听器Lisener
- 分享微信开发Html5轻游戏中的几个坑
- Android IPC进程间通讯机制
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- 在 Ubuntu 桌面中使用文件和文件夹
- 介绍一款信息管理系统的开源框架---jeecg
- 聚类算法之kmeans算法java版本
- java实现 PageRank算法
- 如何在 Fedora 上安装 MongoDB 服务器
- ubuntu下chrome无法同步问题解决
- Ubuntu Linux使用体验