public class LightVirtualFile extends LightVirtualFileBase
VirtualFile
.VirtualFile.PropName
EMPTY_ARRAY, PROP_ENCODING, PROP_HIDDEN, PROP_NAME, PROP_SYMLINK_TARGET, PROP_WRITABLE
EVER_CHANGED, NEVER_CHANGED
Constructor and Description |
---|
LightVirtualFile() |
LightVirtualFile(java.lang.String name) |
LightVirtualFile(java.lang.String name,
java.lang.CharSequence content) |
LightVirtualFile(java.lang.String name,
FileType fileType,
java.lang.CharSequence text) |
LightVirtualFile(java.lang.String name,
FileType fileType,
java.lang.CharSequence text,
java.nio.charset.Charset charset,
long modificationStamp) |
LightVirtualFile(java.lang.String name,
FileType fileType,
java.lang.CharSequence text,
long modificationStamp) |
LightVirtualFile(java.lang.String name,
Language language,
java.lang.CharSequence text) |
LightVirtualFile(VirtualFile original,
java.lang.CharSequence text,
long modificationStamp) |
Modifier and Type | Method and Description |
---|---|
byte [] |
contentsToByteArray()
Returns file content as an array of bytes.
|
java.lang.CharSequence |
getContent() |
java.io.InputStream |
getInputStream()
Gets the
InputStream for this file. |
Language |
getLanguage() |
java.io.OutputStream |
getOutputStream(java.lang.Object requestor,
long newModificationStamp,
long newTimeStamp)
Gets the
OutputStream for this file and sets modification stamp and time stamp to the specified values
after closing the stream. |
ThreeState |
isTooLargeForIntelligence() |
void |
setContent(java.lang.Object requestor,
java.lang.CharSequence content,
boolean fireEvent) |
void |
setLanguage(Language language) |
java.lang.String |
toString() |
createChildData, createChildDirectory, delete, getAssignedFileType, getChildren, getFileSystem, getLength, getModificationStamp, getName, getOriginalFile, getParent, getPath, getTimeStamp, isDirectory, isValid, isWritable, move, refresh, rename, setBinaryContent, setBinaryContent, setFileType, setModificationStamp, setOriginalFile, setValid, setWritable
contentsToByteArray, copy, exists, findChild, findFileByRelativePath, findOrCreateChildData, getBOM, getCanonicalFile, getCanonicalPath, getCharset, getDetectedLineSeparator, getExtension, getFileType, getModificationCount, getNameSequence, getNameWithoutExtension, getOutputStream, getPresentableName, getPresentableUrl, getUrl, is, isCharsetSet, isInLocalFileSystem, isRecursiveOrCircularSymLink, isValidName, nameEquals, refresh, setBinaryContent, setBOM, setCharset, setCharset, setCharset, setDetectedLineSeparator, setPreloadedContentHint, storeCharset
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
public LightVirtualFile()
public LightVirtualFile(java.lang.String name)
public LightVirtualFile(java.lang.String name, java.lang.CharSequence content)
public LightVirtualFile(java.lang.String name, FileType fileType, java.lang.CharSequence text)
public LightVirtualFile(VirtualFile original, java.lang.CharSequence text, long modificationStamp)
public LightVirtualFile(java.lang.String name, FileType fileType, java.lang.CharSequence text, long modificationStamp)
public LightVirtualFile(java.lang.String name, FileType fileType, java.lang.CharSequence text, java.nio.charset.Charset charset, long modificationStamp)
public LightVirtualFile(java.lang.String name, Language language, java.lang.CharSequence text)
public Language getLanguage()
public void setLanguage(Language language)
public java.io.InputStream getInputStream() throws java.io.IOException
VirtualFile
InputStream
for this file.
Skips BOM if there is any. See Unicode Byte Order Mark FAQ for an explanation.getInputStream
in class VirtualFile
InputStream
java.io.IOException
- if an I/O error occursVirtualFile.contentsToByteArray()
public java.io.OutputStream getOutputStream(java.lang.Object requestor, long newModificationStamp, long newTimeStamp) throws java.io.IOException
VirtualFile
Gets the OutputStream
for this file and sets modification stamp and time stamp to the specified values
after closing the stream.
Normally, you should not use this method.
Writes BOM first, if there is any. See Unicode Byte Order Mark FAQ for an explanation.
getOutputStream
in class VirtualFile
requestor
- any object to control who called this method. Note that
it is considered to be an external change if requestor
is null
.
See VirtualFileEvent.getRequestor()
and SafeWriteRequestor
.newModificationStamp
- new modification stamp or -1 if no special value should be setnewTimeStamp
- new time stamp or -1 if no special value should be setOutputStream
java.io.IOException
- if an I/O error occursVirtualFile.getModificationStamp()
public byte [] contentsToByteArray() throws java.io.IOException
VirtualFile
contentsToByteArray
in class VirtualFile
java.io.IOException
- if an I/O error occursVirtualFile.contentsToByteArray(boolean)
,
VirtualFile.getInputStream()
public void setContent(java.lang.Object requestor, java.lang.CharSequence content, boolean fireEvent)
public java.lang.CharSequence getContent()
public ThreeState isTooLargeForIntelligence()
public java.lang.String toString()
toString
in class VirtualFile