//import com.UpYun;
//import com.upyun.UpException;
//import org.junit.Assert;
//import org.junit.Test;
//
//import java.io.File;
//import java.io.IOException;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//import static org.junit.Assert.assertTrue;
//
//
////请æ±å¤ªé¢ç¹å®¹æå¤±è´¥ å½±å maven ä¸ä¼ 注éä¹
//public class TestFileBucket {
//
// private static final String BUCKET_NAME = "sdkimg";
// private static final String OPERATOR_NAME = "tester";
// private static final String OPERATOR_PWD = "grjxv2mxELR3";
//
// private UpYun upyun = new UpYun(BUCKET_NAME, OPERATOR_NAME, OPERATOR_PWD);
//
// /**
// * æ ¹ç®å½
// */
// private static final String DIR_ROOT = "/";
// /**
// * å¤çº§ç®å½
// */
// private static final String DIR_MORE = "/1/2/3/";
// /**
// * ç®å½å
// */
// private static final String FOLDER_NAME = "tmp";
// /**
// * ä¸ä¼ å°upyunçæä»¶å
// */
// private static final String FILE_NAME = "test.txt";
// /**
// * æ¬å°å¾
ä¸ä¼ çæµè¯æä»¶
// */
// private static final String SAMPLE_TXT_FILE = System.getProperty("user.dir") + "/test.txt";
//
// private static final String content = "tmp content";
//
//
// //å建ç®å½æµè¯
// @Test
// public void testMkDir() throws IOException, UpException {
// // æ¹æ³1ï¼å建ä¸çº§ç®å½
// String dir1 = DIR_ROOT + FOLDER_NAME;
//
// boolean result1 = upyun.mkDir(dir1);
// assertTrue(result1);
//
// // æ¹æ³2ï¼å建å¤çº§ç®å½ï¼èªå¨å建ç¶çº§ç®å½ï¼æå¤10级ï¼
// String dir2 = DIR_MORE + FOLDER_NAME;
//
// boolean result2 = upyun.mkDir(dir2, true);
// assertTrue(result2);
// }
//
// //ä¸ä¼ æ®éæä»¶æµè¯
// @Test
// public void testWriteFile() throws IOException, UpException {
// // ä¿åå¨åæäºçæä»¶è·¯å¾
// String filePath = DIR_ROOT + FILE_NAME;
// // ä¿åå¨åæäºçæä»¶è·¯å¾ï¼å¤çº§ç®å½
// String filePath2 = DIR_MORE + FILE_NAME;
//
// /*
// * ä¸ä¼ æ¹æ³1ï¼ææ¬å
å®¹ç´æ¥ä¸ä¼
// */
// boolean result1 = upyun.writeFile(filePath, content);
// assertTrue(result1);
//
// /*
// * ä¸ä¼ æ¹æ³2ï¼ææ¬å
å®¹ç´æ¥ä¸ä¼ ï¼å¯èªå¨å建ç¶çº§ç®å½ï¼æå¤10级ï¼
// */
// boolean result2 = upyun.writeFile(filePath2, content, true);
// assertTrue(result2);
//
// /*
// * ä¸ä¼ æ¹æ³3ï¼éç¨æ°æ®æµæ¨¡å¼ä¸ä¼ æä»¶ï¼èçå
åï¼ï¼å¯èªå¨å建ç¶çº§ç®å½ï¼æå¤10级ï¼
// */
// File file = new File(SAMPLE_TXT_FILE);
// boolean result3 = upyun.writeFile(filePath, file, true);
// assertTrue(result3);
//
// /*
// * ä¸ä¼ æ¹æ³4ï¼å¯¹å¾
ä¸ä¼ çæä»¶è®¾ç½® MD5 å¼ï¼ç¡®ä¿ä¸ä¼ å° Upyun çæä»¶ç宿´æ§åæ£ç¡®æ§
// */
// File file4 = new File(SAMPLE_TXT_FILE);
// // 设置å¾
ä¸ä¼ æä»¶ç Content-MD5 å¼
// // 妿åæäºæå¡ç«¯æ¶å°çæä»¶MD5å¼ä¸ç¨æ·è®¾ç½®çä¸ä¸è´ï¼å°åæ¥ 406 NotAcceptable é误
// upyun.setContentMD5(UpYun.md5(file4));
//
// boolean result4 = upyun.writeFile(filePath, file4, true);
// assertTrue(result4);
//
// }
//
// //è·åæä»¶ä¿¡æ¯æµè¯
// @Test
// public void testGetFileInfo() throws IOException, UpException {
// // upyun空é´ä¸åå¨çæä»¶çè·¯å¾
// String filePath = DIR_ROOT + FILE_NAME;
//
// Map