@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()); }