Author: dgolovin
Date: 2009-11-09 13:59:07 -0500 (Mon, 09 Nov 2009)
New Revision: 18507
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
Log:
new readStream(IFile) method added
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2009-11-09
18:54:11 UTC (rev 18506)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2009-11-09
18:59:07 UTC (rev 18507)
@@ -184,6 +184,24 @@
}
return sb.toString();
}
+
+ public static String readStream(IFile file) throws CoreException {
+ String content = null;
+ InputStream in = null;
+ try {
+ in = file.getContents();
+ content = FileUtil.readStream(in);
+ } finally {
+ if(in!=null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ CommonPlugin.getPluginLog().logError(e);
+ }
+ }
+ }
+ return content;
+ }
public static boolean writeFile(File f, String value) {
return writeFileWithEncodingCheck(f, value, null);
Show replies by date