public String getCurrentContent() throws JavaModelException { IFile file= getOldFile(new NullProgressMonitor()); if (! file.exists()) return ""; //$NON-NLS-1$ InputStream stream= null; try{ stream= file.getContents(); String encoding= file.getCharset(); String c= NLSUtil.readString(stream, encoding); return (c == null) ? "": c; //$NON-NLS-1$ } catch (CoreException e){ throw new JavaModelException(e, IJavaModelStatusConstants.CORE_EXCEPTION); } finally { try { if (stream != null) stream.close(); } catch (IOException x) { } } }
public String getCurrentContent() throws JavaModelException { IFile file= getOldFile(new NullProgressMonitor()); if (! file.exists()) return ""; //$NON-NLS-1$ InputStream stream= null; try{ stream= file.getContents(); String encoding= file.getCharset(); String c= NLSUtil.readString(stream, encoding); return (c == null) ? "": c; //$NON-NLS-1$ } catch (CoreException e){ throw new JavaModelException(e, IJavaModelStatusConstants.CORE_EXCEPTION); } finally { try { if (stream != null) stream.close(); } catch (IOException x) { } } }
public String getCurrentContent() throws JavaModelException { IFile file= getOldFile(new NullProgressMonitor()); if (! file.exists()) return ""; //$NON-NLS-1$ InputStream stream= null; try{ stream= file.getContents(); String encoding= file.getCharset(); String c= NLSUtil.readString(stream, encoding); return (c == null) ? "": c; //$NON-NLS-1$ } catch (CoreException e){ throw new JavaModelException(e, IJavaModelStatusConstants.CORE_EXCEPTION); } finally { try { if (stream != null) stream.close(); } catch (IOException x) { } } }