![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
java
KeKe_Winner
这个作者很懒,什么都没留下…
展开
-
JAVA使用mysql数据库
errbrifSql="insert into tb_report_smoke_brief (test_event_id,downtime,flashtime,detail,loginfo,versionPath) values (?, ?, ?,?,?,?)";//连接数据库 Connection conn=getConnection(this.url,this.userName,this.password); // 第一个,SQL语句中,值所在的地方,都用问好代表 // 第二个,必须调用Pre原创 2020-12-07 17:35:10 · 111 阅读 · 0 评论 -
JAVA(2) -解析JSON文件
{ "versionNum":"KD6-H6116GHIL-QGo-TRUNK-OP-201111V210", "platform":"mt6761", "summary":{ "result":true, "totalNum":248, "totalTime":"439723.0ms", "percent":"117.35%" }, "AllApks":[ { "原创 2020-11-19 20:02:50 · 125 阅读 · 0 评论 -
JAVA(1) - 读取txt文件
String romfile = Constant.RomResultPath + File.separator + version_number + "rom.txt"; File file = new File(romfile); System.out.println("文件路径" + file.getPath()); //从txt中读取结果 String result = ""; try{ Buff原创 2020-11-19 11:32:18 · 106 阅读 · 0 评论 -
JAVA 打印文件内容
方法一:注意:需要判断文件是否存在,否则会报空指针错误。import java.io.File;import java.io.FileInputStream;public class FileTest {public static void main(String[] args) {FileInputStream fis = null;try {File file = new File(“D://test.txt”);fis = new FileInputStream(file);byt原创 2020-09-10 17:05:41 · 1507 阅读 · 0 评论 -
JAVA --- 压缩文件夹
使用java方法对文件夹进行压缩://输入路径,输出路径,KeepDirStructure:保留原始目录结构 一般都选择truepublic static void toZip(String srcDir, OutputStream out, boolean KeepDirStructure) throws RuntimeException{ long start = System.currentTimeMillis(); ZipOutputStream zos = nu原创 2020-09-11 10:16:02 · 281 阅读 · 0 评论 -
Linux环境下上传文件至服务器---JAVA
public static void pullLogToResorce(File localFile) throws Exception{ SmbFile f; //服务器上的log路径 String smbPath = "smb://" + Constant.LogServerIp; UniAddress ua = UniAddress.getByName(Constant.LogServerIp); NtlmPassword原创 2020-08-20 14:06:57 · 210 阅读 · 0 评论 -
删除文件夹---JAVA
java删除文件夹两种方式:(建议使用递归方式进行删除)方法1:/** * 删除文件夹及其子文件(栈方式) **/public static boolean deleteDirectory(File dir) { Stack<File> stackFiles = new Stack<File>(); stackFiles.push(dir); while (stackFiles.size() > 0) { File c原创 2020-08-20 14:01:42 · 112 阅读 · 0 评论