java目录、文件操作.doc
还剩
16页未读,
继续阅读
下载文档到电脑,马上远离加班熬夜!
亲,喜欢就下载吧,价低环保!
内容要点:
byte[] b = new byte[1024 * 5]; int len; while ( (len = input.read(b)) != -1) { output.write(b, 0, len); } output.flush(); output.close(); input.close(); } i FileOutputStream fs = new FileOutputStream(newPath); byte[] buffer = new byte[1444]; int length; while ( (byteread = inStream.read(buffer)) != -1) { bytesum += byt /** * 删除文件夹里面的所有文件 * @param path String 文件夹路径 如 c:/fqf */ public void delAllFile(String path) { File file = new File(path); if (!file.exists()) { return; } if (!file.isD * 删除文件 * @param filePathAndName String 文件路径及名称 如 c:/fqf.txt * @param fileContent String * @return boolean */ public void delFile(String filePathAndName) { try { String fil String filePath = folderPath; filePath = filePath.toString(); java.io.File myFilePath = new java.io.File(filePath); if (!myFilePath.exists()) { myFilePath.mkdir(); } } cat fileIn.close(); } catch (IOException e) { } } } } private static void listFile(File parentFile, List nameList, List fileList, String directoryName) { if (parentFile.isDirectory()) { File[] files FileInputStream fileIn = null; StringBuffer sb = new StringBuffer(outputZipNameAndPath); // FileInputStream fileIn =null; try { if (outputZipNameAndPath.indexOf(".zip") != -1) { outputZipNameAndPath if(temp.isFile()){ FileOutputStream output = new FileOutputStream(folderList2.get(j) + File.separator + (temp.getName()).toString()); byte[] b = new byte[5120]; int len; while ( (len = input.read(
发表评论
暂无评论,赶快抢占沙发吧。