tomcat log日志压缩另存 需求就是把tomcat中的日志定时处理,将log日志压缩后另存到某个指定的文件夹内。有哪位大侠知道的。告知一下。谢谢!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在java程序里调用rar压缩,然后另存就可以了,............. 给你个解压缩的例子,压缩的就是换下命令参数而已........//使用winrar命令行解压缩String cmd = rarPath + "\\WinRAR.exe x -ibck -y " + SourcePath + "\\" + Filename + " " + SourcePath;// 第二步:执行解压缩//java中调用命令行语句try { //判断是否解压成功 Process proc; proc = Runtime.getRuntime().exec(cmd); if (proc.waitFor() != 0) { throw new Exception("解压文件'" + Filename + "'错误。错误原因exit value =" + proc.exitValue()); } File theFile = new File(SourcePath + "\\" + Filename); theFile.delete();} catch (Exception e) { throw new Exception(e);} hmzip14.jar开源的压缩工具包,压缩后另存,属于java文件操作的范畴了 wula0010大侠 把你的QQ告知我下好吗。用你那个有点问题,问下。。谢谢 2个程序间通讯的问题 大家来谈谈WebService JavaScript公历 年 月 日例子 rs.setString()的问题请赐教 关于url过滤参数的问题?? 请教如何在一个EJB中调用其他jar包中的类 看过struts in action的进来看看!!!!????? Struts环境配置手顺(eclipse版),包括SQL Server的连接! 一个简单实体bean的问题 对于web日志结构的分析。。 servlet的问题。。 java filter过滤admin下的jsp文件,web.xml该怎么写?
String cmd = rarPath + "\\WinRAR.exe x -ibck -y " + SourcePath + "\\" + Filename + " " + SourcePath;
// 第二步:执行解压缩
//java中调用命令行语句
try {
//判断是否解压成功
Process proc;
proc = Runtime.getRuntime().exec(cmd);
if (proc.waitFor() != 0) {
throw new Exception("解压文件'" + Filename + "'错误。错误原因exit value =" + proc.exitValue());
}
File theFile = new File(SourcePath + "\\" + Filename);
theFile.delete();
} catch (Exception e) {
throw new Exception(e);
}