标签:nts auth rgs apach des common 指定路径 mon exp
public static void main(String[] args) { File file = new File("D:\\WindowsETC\\ETC_Managent\\apache-tomcat\\bin");//文件目录 File [] files = file.listFiles(); String fileName = ""; for(File f: files){ fileName = f.getName(); if(fileName.endsWith(".gz")&&fileName.startsWith("ETC")){ if(f.delete()){ System.out.println("已删除文件:"+fileName); } } } }
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.IOUtils; /** * * @ClassName: Md5 * @Description: TODO * @author: 92649498 * @date: 2020年5月12日 下午6:18:30 * Class explain:升级程序生成 MD5 */ public class Md5 { public static void main(String[] args) { //升级包的 路径 生成MD5 String fileName="I:\\升级包\\万能升级包\\2020年5月12日\\LR0_2.3.4.zip"; String md5Hex = null; FileInputStream fileInputStream = null; try { fileInputStream = new FileInputStream(fileName); md5Hex = DigestUtils.md5Hex(IOUtils.toByteArray(fileInputStream)); System.out.println(md5Hex); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { if (fileInputStream != null) { try { fileInputStream.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } String a="2231";//本地 String b="233";//升级包 System.out.println(b.compareTo(a)); if (b.compareTo(a)>0) { System.out.println("升级"); }else { System.out.println("不升级"); } } }
标签:nts auth rgs apach des common 指定路径 mon exp
原文地址:https://www.cnblogs.com/wzy-525/p/12878140.html