public class VirtualDirectoryImpl 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 |
---|---|
void |
addChild(VirtualFileSystemEntry child) |
boolean |
allChildrenLoaded() |
protected boolean |
changeUserMap(KeyFMap oldMap,
KeyFMap newMap) |
byte [] |
contentsToByteArray()
Returns file content as an array of bytes.
|
void |
createAndAddChildren(java.util.List<? extends ChildInfo> added,
boolean markAllChildrenLoaded,
PairConsumer<? super VirtualFile,? super ChildInfo> fileCreated) |
VirtualFileSystemEntry |
createChild(java.lang.String name,
int id,
NewVirtualFileSystem delegate,
FileAttributes attributes,
boolean isEmptyDirectory) |
VirtualFileSystemEntry |
doFindChildById(int id) |
VirtualFileSystemEntry |
findChild(java.lang.String name)
Finds child of this file with the given name.
|
NewVirtualFile |
findChildIfCached(java.lang.String name) |
java.util.List<VirtualFile> |
getCachedChildren() |
VirtualFile [] |
getChildren()
Gets the child files.
|
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 newModificationStamp,
long newTimeStamp)
Gets the
OutputStream for this file and sets modification stamp and time stamp to the specified values
after closing the stream. |
java.util.List<java.lang.String> |
getSuspiciousNames() |
protected KeyFMap |
getUserMap() |
boolean |
isDirectory()
Checks whether this file is a directory.
|
java.lang.Iterable<VirtualFile> |
iterInDbChildren()
iterated children will NOT contain NullVirtualFile.INSTANCE
|
java.lang.Iterable<VirtualFile> |
iterInDbChildrenWithoutLoadingVfsFromOtherProjects() |
void |
markDirtyRecursively() |
NewVirtualFile |
refreshAndFindChild(java.lang.String name) |
void |
removeChild(VirtualFile file) |
void |
removeChildren(TIntHashSet idsToRemove,
java.util.List<? extends java.lang.CharSequence> namesToRemove) |
protected void |
setUserMap(KeyFMap map) |
void |
validateChildrenToCreate(java.util.List<? extends VFileCreateEvent> childrenToCreate) |
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, move, rename, setFileIndexed, setModificationStamp, setNewName, setParent, setTimeStamp, setWritable, toString, updateProperty
refresh
contentsToByteArray, findFileByRelativePath, findOrCreateChildData, getBOM, getDetectedLineSeparator, getExtension, getModificationCount, getNameWithoutExtension, getOutputStream, getPresentableUrl, isCharsetSet, isValidName, nameEquals, refresh, setBinaryContent, setBinaryContent, setBinaryContent, setBOM, setCharset, setCharset, setCharset, setDetectedLineSeparator, setPreloadedContentHint, storeCharset
clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace
public NewVirtualFileSystem getFileSystem()
VirtualFile
VirtualFileSystem
this file belongs to.getFileSystem
in class NewVirtualFile
VirtualFileSystem
public VirtualFileSystemEntry createChild(java.lang.String name, int id, NewVirtualFileSystem delegate, FileAttributes attributes, boolean isEmptyDirectory)
public NewVirtualFile refreshAndFindChild(java.lang.String name)
refreshAndFindChild
in class NewVirtualFile
public NewVirtualFile findChildIfCached(java.lang.String name)
findChildIfCached
in class NewVirtualFile
public java.lang.Iterable<VirtualFile> iterInDbChildren()
NewVirtualFile
iterInDbChildren
in class NewVirtualFile
public java.lang.Iterable<VirtualFile> iterInDbChildrenWithoutLoadingVfsFromOtherProjects()
iterInDbChildrenWithoutLoadingVfsFromOtherProjects
in class NewVirtualFile
public VirtualFile [] getChildren()
VirtualFile
getChildren
in class VirtualFile
null
if this file is not a directorypublic VirtualFileSystemEntry findChild(java.lang.String name)
VirtualFile
findChild
in class NewVirtualFile
name
- the file name to search bynull
otherwisepublic VirtualFileSystemEntry doFindChildById(int id)
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 void createAndAddChildren(java.util.List<? extends ChildInfo> added, boolean markAllChildrenLoaded, PairConsumer<? super VirtualFile,? super ChildInfo> fileCreated)
public void addChild(VirtualFileSystemEntry child)
public void removeChild(VirtualFile file)
public void removeChildren(TIntHashSet idsToRemove, java.util.List<? extends java.lang.CharSequence> namesToRemove)
public void validateChildrenToCreate(java.util.List<? extends VFileCreateEvent> childrenToCreate)
public boolean allChildrenLoaded()
public java.util.List<java.lang.String> getSuspiciousNames()
public boolean isDirectory()
VirtualFile
isDirectory
in class VirtualFile
true
if this file is a directory, false
otherwisepublic java.util.List<VirtualFile> getCachedChildren()
getCachedChildren
in class NewVirtualFile
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 void markDirtyRecursively()
markDirtyRecursively
in class VirtualFileSystemEntry
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