public class TempFileSystem extends LocalFileSystemBase implements VirtualFilePointerCapableFileSystem
LocalFileSystem.WatchRequest
LOG
PROTOCOL, PROTOCOL_PREFIX
DEFAULT_LENGTH, DEFAULT_TIMESTAMP
Constructor and Description |
---|
TempFileSystem() |
Modifier and Type | Method and Description |
---|---|
byte [] |
contentsToByteArray(VirtualFile file) |
VirtualFile |
copyFile(java.lang.Object requestor,
VirtualFile file,
VirtualFile newParent,
java.lang.String copyName)
Implementation of copying files in this file system
|
VirtualFile |
createChildDirectory(java.lang.Object requestor,
VirtualFile parent,
java.lang.String dir)
Implementation of adding directories in this file system
|
VirtualFile |
createChildFile(java.lang.Object requestor,
VirtualFile parent,
java.lang.String file)
Implementation of adding files in this file system
|
void |
deleteFile(java.lang.Object requestor,
VirtualFile file)
Implementation of deleting files in this file system
|
boolean |
exists(VirtualFile fileOrDirectory) |
protected java.lang.String |
extractRootPath(java.lang.String normalizedPath)
IntelliJ platform calls this method with non-null value returned by
NewVirtualFileSystem.normalize(java.lang.String) , but if something went wrong
and an implementation can't extract a valid root path nevertheless, it should return an empty string. |
VirtualFile |
findModelChild(VirtualFile parent,
java.lang.String name) |
FileAttributes |
getAttributes(VirtualFile file)
Reads various file attributes in one shot (to reduce the number of native I/O calls).
|
java.lang.String |
getCanonicallyCasedName(VirtualFile file) |
java.io.InputStream |
getInputStream(VirtualFile file)
Does NOT strip the BOM from the beginning of the stream, unlike the
VirtualFile.getInputStream() |
static TempFileSystem |
getInstance() |
long |
getLength(VirtualFile file) |
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) |
java.lang.String |
getProtocol()
Gets the protocol for this file system.
|
long |
getTimeStamp(VirtualFile file) |
boolean |
isDirectory(VirtualFile file) |
boolean |
isWritable(VirtualFile file) |
java.lang.String [] |
list(VirtualFile file) |
void |
moveFile(java.lang.Object requestor,
VirtualFile file,
VirtualFile newParent)
Implementation of moving files in this file system
|
protected java.lang.String |
normalize(java.lang.String path)
Implementations should convert separator chars to forward slashes and remove duplicates ones,
and convert paths to "absolute" form (so that they start from a root that is valid for this FS and
could be later extracted with
NewVirtualFileSystem.extractRootPath(java.lang.String) ). |
void |
renameFile(java.lang.Object requestor,
VirtualFile file,
java.lang.String newName)
Implementation of renaming files in this file system
|
java.util.Set<LocalFileSystem.WatchRequest> |
replaceWatchedRoots(java.util.Collection<LocalFileSystem.WatchRequest> watchRequests,
java.util.Collection<java.lang.String> recursiveRoots,
java.util.Collection<java.lang.String> flatRoots)
Stops watching given watch requests and starts watching new paths.
|
void |
setTimeStamp(VirtualFile file,
long timeStamp) |
void |
setWritable(VirtualFile file,
boolean writableFlag) |
findFileByIoFile, findFileByPath, findFileByPathIfCached, getRank, hasChildren, isCaseSensitive, isReadOnly, isSymLink, isValidName, markNewFilesAsDirty, refresh, refreshAndFindFileByIoFile, refreshAndFindFileByPath, refreshFiles, refreshFiles, refreshIoFiles, refreshIoFiles, registerAuxiliaryFileOperationsHandler, resolveSymLink, unregisterAuxiliaryFileOperationsHandler
addRootsToWatch, addRootToWatch, removeWatchedRoot, removeWatchedRoots, replaceWatchedRoot
addVirtualFileListener, refreshWithoutFileWatcher, removeVirtualFileListener
extractPresentableUrl
public static TempFileSystem getInstance()
protected java.lang.String extractRootPath(java.lang.String normalizedPath)
NewVirtualFileSystem
NewVirtualFileSystem.normalize(java.lang.String)
, but if something went wrong
and an implementation can't extract a valid root path nevertheless, it should return an empty string.extractRootPath
in class LocalFileSystemBase
public VirtualFile createChildDirectory(java.lang.Object requestor, VirtualFile parent, java.lang.String dir) throws java.io.IOException
VirtualFileSystem
createChildDirectory
in interface FileSystemInterface
createChildDirectory
in class LocalFileSystemBase
java.io.IOException
VirtualFile.createChildDirectory(Object,String)
public VirtualFile createChildFile(java.lang.Object requestor, VirtualFile parent, java.lang.String file)
VirtualFileSystem
createChildFile
in interface FileSystemInterface
createChildFile
in class LocalFileSystemBase
VirtualFile.createChildData(Object,String)
public VirtualFile findModelChild(VirtualFile parent, java.lang.String name)
public VirtualFile copyFile(java.lang.Object requestor, VirtualFile file, VirtualFile newParent, java.lang.String copyName) throws java.io.IOException
VirtualFileSystem
copyFile
in interface FileSystemInterface
copyFile
in class LocalFileSystemBase
java.io.IOException
VirtualFile.copy(Object,VirtualFile,String)
public void deleteFile(java.lang.Object requestor, VirtualFile file)
VirtualFileSystem
deleteFile
in interface FileSystemInterface
deleteFile
in class LocalFileSystemBase
VirtualFile.delete(Object)
public void moveFile(java.lang.Object requestor, VirtualFile file, VirtualFile newParent) throws java.io.IOException
VirtualFileSystem
moveFile
in interface FileSystemInterface
moveFile
in class LocalFileSystemBase
java.io.IOException
VirtualFile.move(Object,VirtualFile)
public void renameFile(java.lang.Object requestor, VirtualFile file, java.lang.String newName)
VirtualFileSystem
renameFile
in interface FileSystemInterface
renameFile
in class LocalFileSystemBase
VirtualFile.rename(Object,String)
public java.lang.String getProtocol()
VirtualFileSystem
KeyedLazyInstanceEP.key
.getProtocol
in class LocalFileSystemBase
VirtualFile.getUrl()
,
VirtualFileManager.getFileSystem(java.lang.String)
public boolean exists(VirtualFile fileOrDirectory)
exists
in interface FileSystemInterface
exists
in class LocalFileSystemBase
public java.lang.String [] list(VirtualFile file)
list
in interface FileSystemInterface
list
in class LocalFileSystemBase
public java.lang.String getCanonicallyCasedName(VirtualFile file)
getCanonicallyCasedName
in class LocalFileSystemBase
public boolean isDirectory(VirtualFile file)
isDirectory
in interface FileSystemInterface
isDirectory
in class LocalFileSystemBase
public long getTimeStamp(VirtualFile file)
getTimeStamp
in interface FileSystemInterface
getTimeStamp
in class LocalFileSystemBase
public void setTimeStamp(VirtualFile file, long timeStamp)
setTimeStamp
in interface FileSystemInterface
setTimeStamp
in class LocalFileSystemBase
public boolean isWritable(VirtualFile file)
isWritable
in interface FileSystemInterface
isWritable
in class LocalFileSystemBase
public void setWritable(VirtualFile file, boolean writableFlag)
setWritable
in interface FileSystemInterface
setWritable
in class LocalFileSystemBase
public byte [] contentsToByteArray(VirtualFile file) throws java.io.IOException
contentsToByteArray
in interface FileSystemInterface
contentsToByteArray
in class LocalFileSystemBase
java.io.IOException
public java.io.InputStream getInputStream(VirtualFile file) throws java.io.IOException
FileSystemInterface
VirtualFile.getInputStream()
getInputStream
in interface FileSystemInterface
getInputStream
in class LocalFileSystemBase
java.io.IOException
public java.io.OutputStream getOutputStream(VirtualFile file, java.lang.Object requestor, long modStamp, long timeStamp) throws java.io.IOException
FileSystemInterface
VirtualFile.getOutputStream(Object)
getOutputStream
in interface FileSystemInterface
getOutputStream
in class LocalFileSystemBase
java.io.IOException
public long getLength(VirtualFile file)
getLength
in interface FileSystemInterface
getLength
in class LocalFileSystemBase
public FileAttributes getAttributes(VirtualFile file)
NewVirtualFileSystem
getAttributes
in class LocalFileSystemBase
file
- file to get attributes of.null
if the file doesn't exist.public java.util.Set<LocalFileSystem.WatchRequest> replaceWatchedRoots(java.util.Collection<LocalFileSystem.WatchRequest> watchRequests, java.util.Collection<java.lang.String> recursiveRoots, java.util.Collection<java.lang.String> flatRoots)
LocalFileSystem
replaceWatchedRoots
in class LocalFileSystem
protected java.lang.String normalize(java.lang.String path)
NewVirtualFileSystem
Implementations should convert separator chars to forward slashes and remove duplicates ones,
and convert paths to "absolute" form (so that they start from a root that is valid for this FS and
could be later extracted with NewVirtualFileSystem.extractRootPath(java.lang.String)
).
Implementations should not normalize paths by eliminating directory traversals or other indirections.
normalize
in class LocalFileSystemBase
null
when a path is invalid for this FS.