public class VfsImplUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Pair<NewVirtualFile,NewVirtualFile> |
findCachedFileByPath(NewVirtualFileSystem vfs,
java.lang.String path) |
static NewVirtualFile |
findFileByPath(NewVirtualFileSystem vfs,
java.lang.String path) |
static NewVirtualFile |
findFileByPathIfCached(NewVirtualFileSystem vfs,
java.lang.String path) |
static void |
forceSyncRefresh(VirtualFile file)
Guru method for force synchronous file refresh.
|
static <T extends ArchiveHandler> |
getHandler(ArchiveFileSystem vfs,
VirtualFile entryFile,
Function<? super java.lang.String,? extends T> producer) |
static void |
refresh(NewVirtualFileSystem vfs,
boolean asynchronous) |
static NewVirtualFile |
refreshAndFindFileByPath(NewVirtualFileSystem vfs,
java.lang.String path) |
public static NewVirtualFile findFileByPath(NewVirtualFileSystem vfs, java.lang.String path)
public static NewVirtualFile findFileByPathIfCached(NewVirtualFileSystem vfs, java.lang.String path)
public static Pair<NewVirtualFile,NewVirtualFile> findCachedFileByPath(NewVirtualFileSystem vfs, java.lang.String path)
public static NewVirtualFile refreshAndFindFileByPath(NewVirtualFileSystem vfs, java.lang.String path)
public static void refresh(NewVirtualFileSystem vfs, boolean asynchronous)
public static void forceSyncRefresh(VirtualFile file)
refresh(NewVirtualFileSystem, boolean)
doesn't work well if the file was changed
twice in short time and content length wasn't changed (for example file modification timestamp for HFS+ works per seconds).
If you're sure that a file is changed twice in a second and you have to get the latest file's state - use this method.
Likely you need this method if you have following code:
FileDocumentManager.getInstance().saveDocument(document);
runExternalToolToChangeFile(virtualFile.getPath()) // changes file externally in milliseconds, probably without changing file's length
VfsUtil.markDirtyAndRefresh(true, true, true, virtualFile); // might be replace with forceSyncRefresh(VirtualFile)
public static <T extends ArchiveHandler> T getHandler(ArchiveFileSystem vfs, VirtualFile entryFile, Function<? super java.lang.String,? extends T> producer)