public class FileContent extends DiffContent
Constructor and Description |
---|
FileContent(Project project,
VirtualFile file) |
Modifier and Type | Method and Description |
---|---|
static FileContent |
createFromTempFile(Project project,
java.lang.String name,
java.lang.String ext,
byte [] content) |
byte[] |
getBytes() |
FileType |
getContentType() |
Document |
getDocument()
Represents this content as Document
null means content has no text representation
|
VirtualFile |
getFile() |
LineSeparator |
getLineSeparator() |
Navigatable |
getOpenFileDescriptor(int offset)
Provides a way to open given text place in editor
null means given offset can't be opened in editor
|
boolean |
isBinary()
Means this content represents binary data.
|
fromDocument, fromFile, isEmpty, setIsEmpty
public FileContent(Project project, VirtualFile file)
public Document getDocument()
DiffContent
getDocument
in class DiffContent
public Navigatable getOpenFileDescriptor(int offset)
DiffContent
getOpenFileDescriptor
in class DiffContent
offset
- in document returned by DiffContent.getDocument()
OpenFileDescriptor
to open this content in editorpublic VirtualFile getFile()
getFile
in class DiffContent
public FileType getContentType()
getContentType
in class DiffContent
public byte[] getBytes() throws java.io.IOException
getBytes
in class DiffContent
DiffContent.getFile()
returns existing not directory filejava.io.IOException
public boolean isBinary()
DiffContent
isBinary
in class DiffContent
public static FileContent createFromTempFile(Project project, java.lang.String name, java.lang.String ext, byte [] content) throws java.io.IOException
java.io.IOException
public LineSeparator getLineSeparator()
getLineSeparator
in class DiffContent