Exemple #1
0
 @Test
 public void test02() throws Exception {
   String urlStr =
       "http://c.hiphotos.baidu.com/image/pic/item/6c224f4a20a44623bb7d15b59c22720e0df3d7b6.jpg";
   //		System.err.println(urlStr.split("//").length);
   StreamUtil.parseUrl2Path(urlStr);
 }
Exemple #2
0
 @Test
 public void test01() throws Exception {
   //		String filename = "eqweqeqeq.jpg";
   //		System.err.println(filename.substring(0, filename.lastIndexOf(".")) + "(1)" +
   // filename.substring(filename.lastIndexOf(".")));
   String path = "D:/NetSpider/";
   String filename = "test.txt";
   // new File(path).mkdir();
   File file = new File(path + filename);
   file = StreamUtil.createFile(file, path, filename);
   new FileOutputStream(file).write("111111".getBytes());
 }