public class VirtualFileImpl extends VirtualFileSystemEntry
VirtualFile.PropName
EMPTY_ARRAY
PROP_ENCODING, PROP_HIDDEN, PROP_NAME, PROP_SYMLINK_TARGET, PROP_WRITABLE
EVER_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, updateProperty
iterInDbChildrenWithoutLoadingVfsFromOtherProjects, refresh
findFileByRelativePath, findOrCreateChildData, getBOM, getExtension, getModificationCount, getNameWithoutExtension, getOutputStream, getPresentableUrl, isCharsetSet, isValidName, nameEquals, refresh, setBinaryContent, setBOM, setCharset, setCharset, setCharset, storeCharset
clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace
public NewVirtualFile findChild(java.lang.String name)
VirtualFile
findChild
in class NewVirtualFile
name
- the file name to search bynull
otherwisepublic java.util.Collection<VirtualFile> getCachedChildren()
getCachedChildren
in class NewVirtualFile
public java.lang.Iterable<VirtualFile> iterInDbChildren()
NewVirtualFile
iterInDbChildren
in class NewVirtualFile
public NewVirtualFileSystem getFileSystem()
VirtualFile
VirtualFileSystem
this file belongs to.getFileSystem
in class NewVirtualFile
VirtualFileSystem
public NewVirtualFile refreshAndFindChild(java.lang.String name)
refreshAndFindChild
in class NewVirtualFile
public NewVirtualFile findChildIfCached(java.lang.String name)
findChildIfCached
in class NewVirtualFile
public VirtualFile[] getChildren()
VirtualFile
getChildren
in class VirtualFile
null
if this file is not a directorypublic boolean isDirectory()
VirtualFile
isDirectory
in class VirtualFile
true
if this file is a directory, false
otherwisepublic void setPreloadedContentHint(byte[] preloadedContentHint)
setPreloadedContentHint
in class VirtualFile
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 byte [] contentsToByteArray() throws java.io.IOException
VirtualFile
contentsToByteArray
in class NewVirtualFile
java.io.IOException
- if an I/O error occursVirtualFile.contentsToByteArray(boolean)
,
VirtualFile.getInputStream()
public byte [] contentsToByteArray(boolean cacheContent) throws java.io.IOException
VirtualFile
contentsToByteArray
in class VirtualFile
cacheContent
- 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
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
.modStamp
- new modification stamp or -1 if no special value should be settimeStamp
- new time stamp or -1 if no special value should be setOutputStream
java.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 VirtualFile
java.io.IOException
public void setBinaryContent(byte [] content, long newModificationStamp, long newTimeStamp) throws java.io.IOException
setBinaryContent
in class VirtualFile
java.io.IOException
public java.lang.String getDetectedLineSeparator()
getDetectedLineSeparator
in class VirtualFile
LineSeparator
public void setDetectedLineSeparator(java.lang.String separator)
setDetectedLineSeparator
in class VirtualFile
protected void setUserMap(KeyFMap map)
setUserMap
in class UserDataHolderBase
protected KeyFMap getUserMap()
getUserMap
in class UserDataHolderBase
protected boolean changeUserMap(KeyFMap oldMap, KeyFMap newMap)
changeUserMap
in class UserDataHolderBase