`
Jonny-java
  • 浏览: 11639 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论

FileInputStream

    博客分类:
  • java
阅读更多
public static InputStream getInputStream(String filePath) {
  InputStream is =null;
  try {
   is = FileUtil.class.getClassLoader().getResourceAsStream(filePath);
  } catch (Exception ex) {
  
  }
  if (is==null) {
   try {
    is=ClassLoader.getSystemResourceAsStream(filePath);
   } catch (Exception ex) {
   }
  }
  if (is==null) {
  
   try {
    is = new FileInputStream(filePath);
   } catch (FileNotFoundException e) {
   }
  }
  return is;
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics