public class VirtualFileImpl extends VirtualFileSystemEntry
VirtualFile.PropNameEMPTY_ARRAYPROP_ENCODING, PROP_HIDDEN, PROP_NAME, PROP_SYMLINK_TARGET, PROP_WRITABLEEVER_CHANGED, NEVER_CHANGED| Modifier and Type | Method and Description |
|---|---|
protected boolean |
changeUserMap(KeyFMap oldMap,
KeyFMap newMap) |
byte [] |
contentsToByteArray()
Returns file content as an array of bytes.
|
byte [] |
contentsToByteArray(boolean cacheContent)
Returns file content as an array of bytes.
|
NewVirtualFile |
findChild(java.lang.String name)
Finds child of this file with the given name.
|
NewVirtualFile |
findChildIfCached(java.lang.String name) |
java.util.Collection<VirtualFile> |
getCachedChildren() |
VirtualFile[] |
getChildren()
Gets the child files.
|
java.lang.String |
getDetectedLineSeparator() |
NewVirtualFileSystem |
getFileSystem()
Gets the
VirtualFileSystem this file belongs to. |
java.io.InputStream |
getInputStream()
Gets the
InputStream for this file. |
java.io.OutputStream |
getOutputStream(java.lang.Object requestor,
long modStamp,
long timeStamp)
Gets the
OutputStream for this file and sets modification stamp and time stamp to the specified values
after closing the stream. |
protected KeyFMap |
getUserMap() |
boolean |
isDirectory()
Checks whether this file is a directory.
|
java.lang.Iterable<VirtualFile> |
iterInDbChildren()
iterated children will NOT contain NullVirtualFile.INSTANCE
|
NewVirtualFile |
refreshAndFindChild(java.lang.String name) |
void |
setBinaryContent(byte [] content,
long newModificationStamp,
long newTimeStamp) |
void |
setBinaryContent(byte [] content,
long newModificationStamp,
long newTimeStamp,
java.lang.Object requestor) |
void |
setDetectedLineSeparator(java.lang.String separator) |
void |
setPreloadedContentHint(byte[] preloadedContentHint) |
protected void |
setUserMap(KeyFMap map) |
appendPathOnFileSystem, copy, createChildData, createChildDirectory, delete, equals, exists, getCanonicalFile, getCanonicalPath, getCharset, getFileType, getId, getLength, getModificationStamp, getName, getNameId, getNameSequence, getParent, getPath, getPresentableName, getTimeStamp, getUrl, hashCode, invalidate, is, isDirty, isFileIndexed, isInLocalFileSystem, isRecursiveOrCircularSymLink, isValid, isWritable, markClean, markDirty, markDirtyRecursively, move, rename, setFileIndexed, setModificationStamp, setNewName, setParent, setTimeStamp, setWritable, toString, updatePropertyiterInDbChildrenWithoutLoadingVfsFromOtherProjects, refreshfindFileByRelativePath, findOrCreateChildData, getBOM, getExtension, getModificationCount, getNameWithoutExtension, getOutputStream, getPresentableUrl, isCharsetSet, isValidName, nameEquals, refresh, setBinaryContent, setBOM, setCharset, setCharset, setCharset, storeCharsetclearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replacepublic NewVirtualFile findChild(java.lang.String name)
VirtualFilefindChild in class NewVirtualFilename - the file name to search bynull otherwisepublic java.util.Collection<VirtualFile> getCachedChildren()
getCachedChildren in class NewVirtualFilepublic java.lang.Iterable<VirtualFile> iterInDbChildren()
NewVirtualFileiterInDbChildren in class NewVirtualFilepublic NewVirtualFileSystem getFileSystem()
VirtualFileVirtualFileSystem this file belongs to.getFileSystem in class NewVirtualFileVirtualFileSystempublic NewVirtualFile refreshAndFindChild(java.lang.String name)
refreshAndFindChild in class NewVirtualFilepublic NewVirtualFile findChildIfCached(java.lang.String name)
findChildIfCached in class NewVirtualFilepublic VirtualFile[] getChildren()
VirtualFilegetChildren in class VirtualFilenull if this file is not a directorypublic boolean isDirectory()
VirtualFileisDirectory in class VirtualFiletrue if this file is a directory, false otherwisepublic void setPreloadedContentHint(byte[] preloadedContentHint)
setPreloadedContentHint in class VirtualFilepublic java.io.InputStream getInputStream()
throws java.io.IOException
VirtualFileInputStream for this file.
Skips BOM if there is any. See Unicode Byte Order Mark FAQ for an explanation.getInputStream in class VirtualFileInputStreamjava.io.IOException - if an I/O error occursVirtualFile.contentsToByteArray()public byte [] contentsToByteArray()
throws java.io.IOException
VirtualFilecontentsToByteArray in class NewVirtualFilejava.io.IOException - if an I/O error occursVirtualFile.contentsToByteArray(boolean),
VirtualFile.getInputStream()public byte [] contentsToByteArray(boolean cacheContent)
throws java.io.IOException
VirtualFilecontentsToByteArray in class VirtualFilecacheContent - set true tojava.io.IOException - if an I/O error occursVirtualFile.contentsToByteArray()public java.io.OutputStream getOutputStream(java.lang.Object requestor,
long modStamp,
long timeStamp)
throws java.io.IOException
VirtualFileGets 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 VirtualFilerequestor - 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.modStamp - new modification stamp or -1 if no special value should be settimeStamp - new time stamp or -1 if no special value should be setOutputStreamjava.io.IOException - if an I/O error occursVirtualFile.getModificationStamp()public void setBinaryContent(byte [] content,
long newModificationStamp,
long newTimeStamp,
java.lang.Object requestor)
throws java.io.IOException
setBinaryContent in class VirtualFilejava.io.IOExceptionpublic void setBinaryContent(byte [] content,
long newModificationStamp,
long newTimeStamp)
throws java.io.IOException
setBinaryContent in class VirtualFilejava.io.IOExceptionpublic java.lang.String getDetectedLineSeparator()
getDetectedLineSeparator in class VirtualFileLineSeparatorpublic void setDetectedLineSeparator(java.lang.String separator)
setDetectedLineSeparator in class VirtualFileprotected void setUserMap(KeyFMap map)
setUserMap in class UserDataHolderBaseprotected KeyFMap getUserMap()
getUserMap in class UserDataHolderBaseprotected boolean changeUserMap(KeyFMap oldMap, KeyFMap newMap)
changeUserMap in class UserDataHolderBase