Why is there this Demo? There are roughly two reasons:
1. Android PCS sdks are officially provided. However, some mobile app developers may only use a small part of Baidu PCS. They wish to implement their own functions to reduce the application size without linking the SDK.
2. developers who use Java as the server obviously cannot use the Android pcs sdk.
Technical documents:
PCS official API description
Usage:
1. Download The PCSUploadDemo. java code.
2. compile it.
(1) here the Java library of Apache Http is used, so download it first: http://hc.apache.org/downloads.cgi. Prepare the jar files.
(2) Set CLASSPATH for compiling:
oliverluan@YanqiangtekiMacBook-Pro:~/Documents/EvWork/PCSUploadDemo$ javac -cp "httpcore-4.3.2.jar:httpclient-4.3.3.jar:httpmime-4.3.3.jar:./" PCSUploadDemo.java
3. Run:
oliverluan@localhost:~/Documents/EvWork/PCSUploadDemo$ java -cp "httpcore-4.3.2.jar:httpclient-4.3.3.jar:httpmime-4.3.3.jar:./:commons-logging-1.1.3.jar" PCSUploadDemoUsage: PCSUploadDemo file_to_upload destination your_access_token
Source code: PCSUploadDemo. java