@NotNull @Override public CharSequence getContentAsText() { if (myFileType.isBinary()) { throw new IllegalDataException( "Cannot obtain text for binary file type : " + myFileType.getDescription()); } final CharSequence content = getUserData(IndexingDataKeys.FILE_TEXT_CONTENT_KEY); if (content != null) { return content; } if (myContentAsText == null) { if (myContent != null) { myContentAsText = LoadTextUtil.getTextByBinaryPresentation(myContent, myCharset); myContent = null; // help gc, indices are expected to use bytes or chars but not both } } return myContentAsText; }
@NotNull @Override public String getDescription() { return fileType.getDescription(); }