public abstract class NewVirtualFile extends VirtualFile implements VirtualFileWithId
VirtualFile.PropName
EMPTY_ARRAY, PROP_ENCODING, PROP_HIDDEN, PROP_NAME, PROP_SYMLINK_TARGET, PROP_WRITABLE
EVER_CHANGED, NEVER_CHANGED
Constructor and Description |
---|
NewVirtualFile() |
Modifier and Type | Method and Description |
---|---|
byte [] |
contentsToByteArray()
Returns file content as an array of bytes.
|
abstract NewVirtualFile |
findChild(java.lang.String name)
Finds child of this file with the given name.
|
abstract NewVirtualFile |
findChildIfCached(java.lang.String name) |
abstract java.util.Collection<VirtualFile> |
getCachedChildren() |
abstract NewVirtualFile |
getCanonicalFile()
Resolves all symbolic links containing in a path to this file and returns a link target.
|
abstract NewVirtualFileSystem |
getFileSystem()
Gets the
VirtualFileSystem this file belongs to. |
abstract int |
getId() |
abstract java.lang.CharSequence |
getNameSequence() |
abstract NewVirtualFile |
getParent()
Gets the parent
VirtualFile . |
abstract boolean |
isDirty() |
boolean |
isValid()
Checks whether this
VirtualFile is valid. |
abstract java.lang.Iterable<VirtualFile> |
iterInDbChildren()
iterated children will NOT contain NullVirtualFile.INSTANCE
|
java.lang.Iterable<VirtualFile> |
iterInDbChildrenWithoutLoadingVfsFromOtherProjects() |
abstract void |
markClean() |
abstract void |
markDirty() |
abstract void |
markDirtyRecursively() |
void |
move(java.lang.Object requestor,
VirtualFile newParent)
Moves this file to another directory.
|
void |
refresh(boolean asynchronous,
boolean recursive,
java.lang.Runnable postRunnable)
The same as
VirtualFile.refresh(boolean, boolean) but also runs postRunnable
after the operation is completed. |
abstract NewVirtualFile |
refreshAndFindChild(java.lang.String name) |
abstract void |
setTimeStamp(long time) |
abstract void |
setWritable(boolean writable) |
contentsToByteArray, copy, createChildData, createChildDirectory, delete, exists, findFileByRelativePath, findOrCreateChildData, getBOM, getCanonicalPath, getCharset, getChildren, getDetectedLineSeparator, getExtension, getFileType, getInputStream, getLength, getModificationCount, getModificationStamp, getName, getNameWithoutExtension, getOutputStream, getOutputStream, getPath, getPresentableName, getPresentableUrl, getTimeStamp, getUrl, is, isCharsetSet, isDirectory, isInLocalFileSystem, isRecursiveOrCircularSymLink, isValidName, isWritable, nameEquals, refresh, rename, setBinaryContent, setBinaryContent, setBinaryContent, setBOM, setCharset, setCharset, setCharset, setDetectedLineSeparator, setPreloadedContentHint, storeCharset, toString
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
public boolean isValid()
VirtualFile
VirtualFile
is valid. File can be invalidated either by deleting it or one of its
parents with VirtualFile.delete(java.lang.Object)
method or by an external change.
If file is not valid only Object.equals(java.lang.Object)
, Object.hashCode()
,
VirtualFile.getName()
, VirtualFile.getPath()
, VirtualFile.getUrl()
, VirtualFile.getPresentableUrl()
and methods from
UserDataHolder
can be called for it. Using any other methods for an invalid VirtualFile
instance
produce unpredictable results.isValid
in class VirtualFile
true
if this is a valid file, false
otherwisepublic 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 abstract NewVirtualFileSystem getFileSystem()
VirtualFile
VirtualFileSystem
this file belongs to.getFileSystem
in class VirtualFile
VirtualFileSystem
public abstract NewVirtualFile getParent()
VirtualFile
VirtualFile
.getParent
in class VirtualFile
null
if this file is a root directorypublic abstract NewVirtualFile getCanonicalFile()
VirtualFile
Resolves all symbolic links containing in a path to this file and returns a link target.
Note: please use this method judiciously. In most cases VFS clients don't need to resolve links in paths and should work with those provided by a user.
getCanonicalFile
in class VirtualFile
this
if there are no symbolic links in a file's path;
instance of VirtualFile
if the link was successfully resolved;
null
otherwisepublic abstract NewVirtualFile findChild(java.lang.String name)
VirtualFile
findChild
in class VirtualFile
name
- the file name to search bynull
otherwisepublic abstract NewVirtualFile refreshAndFindChild(java.lang.String name)
public abstract NewVirtualFile findChildIfCached(java.lang.String name)
public abstract void setTimeStamp(long time) throws java.io.IOException
java.io.IOException
public abstract java.lang.CharSequence getNameSequence()
getNameSequence
in class VirtualFile
public abstract int getId()
getId
in interface VirtualFileWithId
public void refresh(boolean asynchronous, boolean recursive, java.lang.Runnable postRunnable)
VirtualFile
VirtualFile.refresh(boolean, boolean)
but also runs postRunnable
after the operation is completed. The runnable is executed on event dispatch thread inside write action.refresh
in class VirtualFile
public abstract void setWritable(boolean writable) throws java.io.IOException
setWritable
in class VirtualFile
java.io.IOException
public abstract void markDirty()
public abstract void markDirtyRecursively()
public abstract boolean isDirty()
public abstract void markClean()
public void move(java.lang.Object requestor, VirtualFile newParent) throws java.io.IOException
VirtualFile
Application.runWriteAction(java.lang.Runnable)
.move
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()
newParent
- the directory to move this file tojava.io.IOException
- if file failed to be movedpublic abstract java.util.Collection<VirtualFile> getCachedChildren()
public abstract java.lang.Iterable<VirtualFile> iterInDbChildren()
public java.lang.Iterable<VirtualFile> iterInDbChildrenWithoutLoadingVfsFromOtherProjects()