替换css 文件中的内容
来源:互联网 发布:网络去哪里举报有钱奖 编辑:程序博客网 时间:2024/04/28 18:43
public static void replaceColor(String regex,String colorcode) {//regex是要替换的字符串正则表达式,colorcode是要替换成的字符串
String temp = "";
try {
File file = new File(System.getProperties().getProperty("catalina.base")+"//deploy//eartest.ear//jsptest.war//"+"allstyle//style.css");
FileInputStream fis = new FileInputStream(file);
InputStreamReader isr = new InputStreamReader(fis);
BufferedReader br = new BufferedReader(isr);
StringBuffer buf = new StringBuffer();
while((temp=br.readLine())!=null)
{
buf.append(temp);
}
String filestr= buf.toString().replaceAll(regex, colorcode);
FileOutputStream fos = new FileOutputStream(file);
fos.write(filestr.getBytes());
} catch (IOException e) {
e.printStackTrace();
}
}
- 替换css 文件中的内容
- 替换文件中的内容
- [sed] 用sed替换文件中的内容
- 替换某个文件中的内容的方法
- python替换文件中的指定内容
- Template 替换文件内容中的变量
- 【Shell】批量替换/删除文件中的内容
- eclipse 全局替换文件中的内容
- 替换文件目录下特定文件中的内容
- 文件内容查找替换
- shell 替换文件内容
- java 文件内容替换
- 批处理替换文件内容
- 文件内容替换
- Python 替换文件内容
- linux 替换文件内容
- python 文件内容替换
- 批处理替换文件内容
- ubuntu输入法安装
- JAVA文件操作类和文件夹的操作
- GPRS DTU是什么?其工作原理是什么?
- 用枚举器itertor的原因
- Gtk与Qt编译环境安装与配置
- 替换css 文件中的内容
- 储存过程中使用临时表
- 午夜漫步中关村西街
- Linux系统操作常用快捷键
- 改变GridView文本框内容,另一列自动更新。
- 使用Limit参数优化MySQL查询 潇湘博客
- 全站防SQL注入类的修改版本
- C++异常传递的三种方式
- 多线程进阶代码一