public final class PersistentFSImpl extends PersistentFS implements Disposable
PersistentFS.Attributes
Disposable.Parent
DEFAULT_LENGTH, DEFAULT_TIMESTAMP
Constructor and Description |
---|
PersistentFSImpl() |
Modifier and Type | Method and Description |
---|---|
int |
acquireContent(VirtualFile file) |
boolean |
areChildrenLoaded(VirtualFile dir) |
void |
cleanPersistedContent(int id) |
void |
cleanPersistedContents() |
void |
clearIdCache() |
byte [] |
contentsToByteArray(int contentId) |
byte [] |
contentsToByteArray(VirtualFile file) |
byte [] |
contentsToByteArray(VirtualFile file,
boolean cacheContent) |
VirtualFile |
copyFile(java.lang.Object requestor,
VirtualFile file,
VirtualFile parent,
java.lang.String name) |
VirtualFile |
createChildDirectory(java.lang.Object requestor,
VirtualFile parent,
java.lang.String dir) |
VirtualFile |
createChildFile(java.lang.Object requestor,
VirtualFile parent,
java.lang.String file) |
void |
deleteFile(java.lang.Object requestor,
VirtualFile file) |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
boolean |
exists(VirtualFile fileOrDirectory) |
NewVirtualFile |
findFileById(int id) |
NewVirtualFile |
findFileByIdIfCached(int id) |
VirtualFileSystemEntry |
findRoot(java.lang.String path,
NewVirtualFileSystem fs) |
VirtualFileSystemEntry |
getCachedDir(int id) |
byte [] |
getContentHashIfStored(VirtualFile file) |
long |
getCreationTimestamp() |
int |
getCurrentContentId(VirtualFile file) |
int |
getFileAttributes(int id) |
int |
getFilesystemModificationCount() |
int |
getId(VirtualFile parent,
java.lang.String childName,
NewVirtualFileSystem fs) |
java.io.InputStream |
getInputStream(VirtualFile file)
Does NOT strip the BOM from the beginning of the stream, unlike the
VirtualFile.getInputStream() |
long |
getLastRecordedLength(VirtualFile file) |
long |
getLength(VirtualFile file) |
VirtualFile [] |
getLocalRoots() |
int |
getModificationCount() |
int |
getModificationCount(VirtualFile file) |
java.lang.String |
getName(int id) |
VirtualFileSystemEntry |
getOrCacheDir(int id,
VirtualDirectoryImpl newDir) |
java.io.OutputStream |
getOutputStream(VirtualFile file,
java.lang.Object requestor,
long modStamp,
long timeStamp)
Does NOT add the BOM to the beginning of the stream, unlike the
VirtualFile.getOutputStream(Object) |
VirtualFile [] |
getRoots() |
VirtualFile [] |
getRoots(NewVirtualFileSystem fs) |
int |
getStructureModificationCount() |
long |
getTimeStamp(VirtualFile file) |
void |
incStructuralModificationCount() |
boolean |
isDirectory(VirtualFile file) |
boolean |
isHidden(VirtualFile file) |
boolean |
isSymLink(VirtualFile file) |
boolean |
isWritable(VirtualFile file) |
java.lang.String [] |
list(VirtualFile file) |
FSRecords.NameId [] |
listAll(VirtualFile file) |
java.lang.String [] |
listPersisted(VirtualFile parent) |
boolean |
mayHaveChildren(int id) |
void |
moveFile(java.lang.Object requestor,
VirtualFile file,
VirtualFile newParent) |
void |
processEvents(java.util.List<? extends VFileEvent> events) |
java.io.DataInputStream |
readAttribute(VirtualFile file,
FileAttribute att) |
void |
releaseContent(int contentId) |
void |
renameFile(java.lang.Object requestor,
VirtualFile file,
java.lang.String newName) |
java.lang.String |
resolveSymLink(VirtualFile file) |
void |
setTimeStamp(VirtualFile file,
long modStamp) |
void |
setWritable(VirtualFile file,
boolean writableFlag) |
int |
storeUnlinkedContent(byte [] bytes) |
java.lang.String |
toString() |
boolean |
wereChildrenAccessed(VirtualFile dir) |
java.io.DataOutputStream |
writeAttribute(VirtualFile file,
FileAttribute att) |
getInstance, isDirectory, isHidden, isSpecialFile, isSymLink, isWritable, replaceWithNativeFS, toFileAttributes
public void dispose()
Disposable
dispose
in interface Disposable
public boolean areChildrenLoaded(VirtualFile dir)
areChildrenLoaded
in class ManagingFS
public long getCreationTimestamp()
getCreationTimestamp
in class ManagingFS
public VirtualFileSystemEntry getOrCacheDir(int id, VirtualDirectoryImpl newDir)
public VirtualFileSystemEntry getCachedDir(int id)
public boolean wereChildrenAccessed(VirtualFile dir)
wereChildrenAccessed
in class ManagingFS
public java.lang.String [] list(VirtualFile file)
list
in interface FileSystemInterface
public java.lang.String [] listPersisted(VirtualFile parent)
listPersisted
in class PersistentFS
public FSRecords.NameId [] listAll(VirtualFile file)
listAll
in class PersistentFS
public java.io.DataInputStream readAttribute(VirtualFile file, FileAttribute att)
readAttribute
in class ManagingFS
public java.io.DataOutputStream writeAttribute(VirtualFile file, FileAttribute att)
writeAttribute
in class ManagingFS
public int storeUnlinkedContent(byte [] bytes)
storeUnlinkedContent
in class PersistentFS
public int getModificationCount(VirtualFile file)
getModificationCount
in class ManagingFS
public int getModificationCount()
getModificationCount
in class ManagingFS
ManagingFS.getStructureModificationCount()
,
ManagingFS.getFilesystemModificationCount()
public int getStructureModificationCount()
getStructureModificationCount
in class ManagingFS
ManagingFS.getModificationCount()
public void incStructuralModificationCount()
public int getFilesystemModificationCount()
getFilesystemModificationCount
in class ManagingFS
ManagingFS.getModificationCount(VirtualFile)
.
This number is persisted between IDE sessions and so it'll always increase. This method invocation means disk access, so it's not terribly cheap.public int getFileAttributes(int id)
getFileAttributes
in class PersistentFS
public boolean isDirectory(VirtualFile file)
isDirectory
in interface FileSystemInterface
public boolean exists(VirtualFile fileOrDirectory)
exists
in interface FileSystemInterface
public long getTimeStamp(VirtualFile file)
getTimeStamp
in interface FileSystemInterface
public void setTimeStamp(VirtualFile file, long modStamp) throws java.io.IOException
setTimeStamp
in interface FileSystemInterface
java.io.IOException
public boolean isSymLink(VirtualFile file)
isSymLink
in interface FileSystemInterface
public java.lang.String resolveSymLink(VirtualFile file)
resolveSymLink
in interface FileSystemInterface
public boolean isWritable(VirtualFile file)
isWritable
in interface FileSystemInterface
public boolean isHidden(VirtualFile file)
isHidden
in class PersistentFS
public void setWritable(VirtualFile file, boolean writableFlag) throws java.io.IOException
setWritable
in interface FileSystemInterface
java.io.IOException
public int getId(VirtualFile parent, java.lang.String childName, NewVirtualFileSystem fs)
getId
in class PersistentFS
public long getLength(VirtualFile file)
getLength
in interface FileSystemInterface
public long getLastRecordedLength(VirtualFile file)
getLastRecordedLength
in class PersistentFS
public VirtualFile copyFile(java.lang.Object requestor, VirtualFile file, VirtualFile parent, java.lang.String name) throws java.io.IOException
copyFile
in interface FileSystemInterface
java.io.IOException
public VirtualFile createChildDirectory(java.lang.Object requestor, VirtualFile parent, java.lang.String dir) throws java.io.IOException
createChildDirectory
in interface FileSystemInterface
java.io.IOException
public VirtualFile createChildFile(java.lang.Object requestor, VirtualFile parent, java.lang.String file) throws java.io.IOException
createChildFile
in interface FileSystemInterface
java.io.IOException
public void deleteFile(java.lang.Object requestor, VirtualFile file) throws java.io.IOException
deleteFile
in interface FileSystemInterface
java.io.IOException
public void renameFile(java.lang.Object requestor, VirtualFile file, java.lang.String newName) throws java.io.IOException
renameFile
in interface FileSystemInterface
java.io.IOException
public byte [] contentsToByteArray(VirtualFile file) throws java.io.IOException
contentsToByteArray
in interface FileSystemInterface
java.io.IOException
public byte [] contentsToByteArray(VirtualFile file, boolean cacheContent) throws java.io.IOException
contentsToByteArray
in class PersistentFS
java.io.IOException
public byte [] contentsToByteArray(int contentId) throws java.io.IOException
contentsToByteArray
in class PersistentFS
java.io.IOException
public java.io.InputStream getInputStream(VirtualFile file) throws java.io.IOException
FileSystemInterface
VirtualFile.getInputStream()
getInputStream
in interface FileSystemInterface
java.io.IOException
public byte [] getContentHashIfStored(VirtualFile file)
public java.io.OutputStream getOutputStream(VirtualFile file, java.lang.Object requestor, long modStamp, long timeStamp)
FileSystemInterface
VirtualFile.getOutputStream(Object)
getOutputStream
in interface FileSystemInterface
public int acquireContent(VirtualFile file)
acquireContent
in class PersistentFS
public void releaseContent(int contentId)
releaseContent
in class PersistentFS
public int getCurrentContentId(VirtualFile file)
getCurrentContentId
in class PersistentFS
public void moveFile(java.lang.Object requestor, VirtualFile file, VirtualFile newParent) throws java.io.IOException
moveFile
in interface FileSystemInterface
java.io.IOException
public void processEvents(java.util.List<? extends VFileEvent> events)
processEvents
in class PersistentFS
public VirtualFileSystemEntry findRoot(java.lang.String path, NewVirtualFileSystem fs)
findRoot
in class ManagingFS
public void clearIdCache()
clearIdCache
in class PersistentFS
public NewVirtualFile findFileById(int id)
findFileById
in class ManagingFS
public NewVirtualFile findFileByIdIfCached(int id)
findFileByIdIfCached
in class PersistentFS
public VirtualFile [] getRoots()
getRoots
in class ManagingFS
public VirtualFile [] getRoots(NewVirtualFileSystem fs)
getRoots
in class ManagingFS
public VirtualFile [] getLocalRoots()
getLocalRoots
in class ManagingFS
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName(int id)
getName
in class PersistentFS
public void cleanPersistedContent(int id)
public void cleanPersistedContents()
public boolean mayHaveChildren(int id)
mayHaveChildren
in class PersistentFS