public abstract class LightVirtualFileBase extends VirtualFile
VirtualFile.VirtualFile.PropNameEMPTY_ARRAY, PROP_ENCODING, PROP_HIDDEN, PROP_NAME, PROP_SYMLINK_TARGET, PROP_WRITABLEEVER_CHANGED, NEVER_CHANGED| Constructor and Description |
|---|
LightVirtualFileBase(java.lang.String name,
FileType fileType,
long modificationStamp) |
| Modifier and Type | Method and Description |
|---|---|
VirtualFile |
createChildData(java.lang.Object requestor,
java.lang.String name)
Creates a new file in this directory.
|
VirtualFile |
createChildDirectory(java.lang.Object requestor,
java.lang.String name)
Creates a subdirectory in this directory.
|
void |
delete(java.lang.Object requestor)
Deletes this file.
|
FileType |
getAssignedFileType() |
VirtualFile[] |
getChildren()
Gets the child files.
|
VirtualFileSystem |
getFileSystem()
Gets the
VirtualFileSystem this file belongs to. |
long |
getLength()
File length in bytes.
|
long |
getModificationStamp()
Gets modification stamp value.
|
java.lang.String |
getName()
Gets the name of this file.
|
VirtualFile |
getOriginalFile() |
VirtualFile |
getParent()
Gets the parent
VirtualFile. |
java.lang.String |
getPath()
Gets the path of this file.
|
long |
getTimeStamp()
Gets the timestamp for this file.
|
boolean |
isDirectory()
Checks whether this file is a directory.
|
boolean |
isValid()
Checks whether this
VirtualFile is valid. |
boolean |
isWritable()
Checks whether this file could be modified.
|
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. |
void |
rename(java.lang.Object requestor,
java.lang.String newName)
Renames this file to the
newName. |
void |
setBinaryContent(byte [] content,
long newModificationStamp,
long newTimeStamp) |
void |
setBinaryContent(byte [] content,
long newModificationStamp,
long newTimeStamp,
java.lang.Object requestor) |
void |
setFileType(FileType fileType) |
protected void |
setModificationStamp(long stamp) |
void |
setOriginalFile(VirtualFile originalFile) |
void |
setValid(boolean valid) |
void |
setWritable(boolean writable) |
contentsToByteArray, contentsToByteArray, copy, exists, findChild, findFileByRelativePath, findOrCreateChildData, getBOM, getCanonicalFile, getCanonicalPath, getCharset, getDetectedLineSeparator, getExtension, getFileType, getInputStream, getModificationCount, getNameSequence, getNameWithoutExtension, getOutputStream, getOutputStream, getPresentableName, getPresentableUrl, getUrl, is, isCharsetSet, isInLocalFileSystem, isRecursiveOrCircularSymLink, isValidName, nameEquals, refresh, setBinaryContent, setBOM, setCharset, setCharset, setCharset, setDetectedLineSeparator, setPreloadedContentHint, storeCharset, toStringchangeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMappublic LightVirtualFileBase(java.lang.String name,
FileType fileType,
long modificationStamp)
public void setFileType(FileType fileType)
public VirtualFile getOriginalFile()
public void setOriginalFile(VirtualFile originalFile)
public VirtualFileSystem getFileSystem()
VirtualFileVirtualFileSystem this file belongs to.getFileSystem in class VirtualFileVirtualFileSystempublic FileType getAssignedFileType()
public java.lang.String getPath()
VirtualFileVirtualFileSystem. Format of the path depends on the concrete file system.
For LocalFileSystem it is an absolute file path with file separator characters
(File.separatorChar) replaced to the forward slash ('/').getPath in class VirtualFilepublic java.lang.String getName()
VirtualFilegetName in class VirtualFileVirtualFile.getNameSequence()public boolean isWritable()
VirtualFileisWritable in class VirtualFiletrue if this file is writable, false otherwisepublic boolean isDirectory()
VirtualFileisDirectory in class VirtualFiletrue if this file is a directory, false otherwisepublic boolean isValid()
VirtualFileVirtualFile 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 VirtualFiletrue if this is a valid file, false otherwisepublic void setValid(boolean valid)
public VirtualFile getParent()
VirtualFileVirtualFile.getParent in class VirtualFilenull if this file is a root directorypublic VirtualFile[] getChildren()
VirtualFilegetChildren in class VirtualFilenull if this file is not a directorypublic long getModificationStamp()
VirtualFilegetModificationStamp in class VirtualFileVirtualFile.getTimeStamp()protected void setModificationStamp(long stamp)
public long getTimeStamp()
VirtualFilegetTimeStamp in class VirtualFileFile.lastModified()public long getLength()
VirtualFilegetLength in class VirtualFilepublic void refresh(boolean asynchronous,
boolean recursive,
java.lang.Runnable postRunnable)
VirtualFileVirtualFile.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 VirtualFilepublic void setWritable(boolean writable)
setWritable in class VirtualFilepublic void rename(java.lang.Object requestor,
java.lang.String newName)
throws java.io.IOException
VirtualFileRenames this file to the newName.
This method should only be called within write action.
rename 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()newName - the new file namejava.io.IOException - if file failed to be renamedpublic VirtualFile createChildDirectory(java.lang.Object requestor, java.lang.String name) throws java.io.IOException
VirtualFileApplication.runWriteAction(java.lang.Runnable).createChildDirectory 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()name - directory nameVirtualFile representing the created directoryjava.io.IOException - if directory failed to be createdpublic VirtualFile createChildData(java.lang.Object requestor, java.lang.String name) throws java.io.IOException
VirtualFileApplication.runWriteAction(java.lang.Runnable).createChildData 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()VirtualFile representing the created filejava.io.IOException - if file failed to be createdpublic void delete(java.lang.Object requestor)
throws java.io.IOException
VirtualFileApplication.runWriteAction(java.lang.Runnable).delete 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()java.io.IOException - if file failed to be deletedpublic void move(java.lang.Object requestor,
VirtualFile newParent)
throws java.io.IOException
VirtualFileApplication.runWriteAction(java.lang.Runnable).move 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()newParent - the directory to move this file tojava.io.IOException - if file failed to be movedpublic void setBinaryContent(byte [] content,
long newModificationStamp,
long newTimeStamp)
throws java.io.IOException
setBinaryContent in class VirtualFilejava.io.IOExceptionpublic void setBinaryContent(byte [] content,
long newModificationStamp,
long newTimeStamp,
java.lang.Object requestor)
throws java.io.IOException
setBinaryContent in class VirtualFilejava.io.IOException