public static String filterHtml(String string)
{
String str = string.replaceAll("<[a-zA-Z]+[1-9]?[^><]*>", "").replaceAll("</[a-zA-Z]+[1-9]?>", "");
return str;
}

  

复制文件到指定位置
public static boolean inPutStreamTofile(InputStream inStream, String targetfile)
{
FileOutputStream fs = null;
try
{
File target = new File(targetfile);
File dir = target.getParentFile();
if (!dir.exists())
{
dir.mkdirs();
}
if (target.exists())
{
target.delete();
}
target.createNewFile();
fs = new FileOutputStream(target);
byte[] buffer = new byte[1024];
int byteread = 0;
while ((byteread = inStream.read(buffer)) != -1)
{
fs.write(buffer, 0, byteread);
}
return true;
}
catch (Exception e)
{
e.printStackTrace();
return false;
}
finally
{
if (fs != null)
{
try
{
fs.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
if (inStream != null)
{
try
{
inStream.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}

  

    public static boolean copyfile(File source, String targetfile)
{
try
{
InputStream inStream = new FileInputStream(source);
return inPutStreamTofile(inStream, targetfile);
}
catch (FileNotFoundException e)
{
e.printStackTrace();
return false;
} }

最新文章

  1. CSS常见技巧
  2. iOS,Objective-C,相册功能的实现。
  3. 李洪强经典iOS面试题11
  4. Qt一个project调用还有一个project的类成员变量
  5. 如何通过logcat查看系统程序的意图
  6. iOS性能调优
  7. ECSHOP在商品详细页面上获取该商品的顶级分类id和名称
  8. 玩转12款Linux开源机器人
  9. 练习使用css3实现3d按钮
  10. Java中设计模式之工厂模式-4
  11. 【luogu1220】关路灯
  12. vue集成百度UEditor富文本编辑器
  13. 使用MongoDB存储集合的一些问题
  14. K8S学习笔记之Kubernetes数据持久化方案
  15. odoo学习之弹框显示
  16. Github上Laravel开源排行榜Star数前30名
  17. springboot 单体架构之shiro集成
  18. day72
  19. ADO与ADO.Net
  20. 删除排序数组中的重复数字 II &#183; Remove Duplicates from Sorted Array II

热门文章

  1. MFC中GetParent()的作用(转)
  2. 华为上机测试题(MP3光标移动-java)
  3. This template requires a more recent version of the Android Eclipse plugin. Please update from versi
  4. Appium+python自动化10-AVD 模拟器【转载】
  5. 使用dom4j工具包对xml文件解析
  6. python cProfile分析程序性能
  7. Centos查看文件夹大小
  8. Southern African 2001 框架折叠 (拓扑序列的应用)
  9. Codeforces 1009F Dominant Indices
  10. 深入JS正则先行断言