public class ModuleFileIndexImpl extends java.lang.Object implements ModuleFileIndex
| Constructor and Description |
|---|
ModuleFileIndexImpl(Module module) |
| Modifier and Type | Method and Description |
|---|---|
static OrderEntry |
findOrderEntryWithOwnerModule(Module ownerModule,
java.util.List<? extends OrderEntry> orderEntries) |
DirectoryInfo |
getInfoForFileOrDirectory(VirtualFile file) |
java.util.List<OrderEntry> |
getOrderEntriesForFile(VirtualFile fileOrDir)
Returns the list of all order entries to which the specified file or directory
belongs.
|
OrderEntry |
getOrderEntryForFile(VirtualFile fileOrDir)
Returns the order entry to which the specified file or directory
belongs.
|
boolean |
isContentSourceFile(VirtualFile file) |
boolean |
isInContent(VirtualFile fileOrDir)
Returns
true if fileOrDir is a file or directory under a content root of this project or module and not excluded or
ignored. |
protected boolean |
isInContent(VirtualFile file,
DirectoryInfo info) |
boolean |
isInSourceContent(VirtualFile fileOrDir)
Returns
true if fileOrDir is a file or directory located under a sources, tests or resources root and not excluded or ignored. |
boolean |
isInTestSourceContent(VirtualFile fileOrDir)
Returns true if
fileOrDir is a file or directory located under a test sources or resources root and not excluded or ignored. |
protected boolean |
isScopeDisposed() |
boolean |
isUnderSourceRootOfType(VirtualFile fileOrDir,
java.util.Set<? extends JpsModuleSourceRootType<?>> rootTypes)
Returns
true if fileOrDir is a file or directory located under a source root of type from rootTypes set and not excluded or ignored |
boolean |
iterateContent(ContentIterator processor)
Processes all files and directories under content roots skipping excluded and ignored files and directories.
|
boolean |
iterateContent(ContentIterator processor,
VirtualFileFilter filter)
Same as
FileIndex.iterateContent(ContentIterator) but allows to pass filter to
provide filtering in condition for directories. |
boolean |
iterateContentUnderDirectory(VirtualFile dir,
ContentIterator processor)
Processes all files and directories in the content under directory
dir (including the directory itself) skipping excluded
and ignored files and directories. |
boolean |
iterateContentUnderDirectory(VirtualFile dir,
ContentIterator processor,
VirtualFileFilter customFilter)
Same as
FileIndex.iterateContentUnderDirectory(VirtualFile, ContentIterator) but allows to pass additional customFilter to
the iterator, in case you need to skip some file system branches using your own logic. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisContentSourceFile, iterateContent, iterateContentUnderDirectory, iterateContentUnderDirectorypublic ModuleFileIndexImpl(Module module)
public boolean iterateContent(ContentIterator processor, VirtualFileFilter filter)
FileIndexFileIndex.iterateContent(ContentIterator) but allows to pass filter to
provide filtering in condition for directories.
If filter returns false on a directory, the directory won't be processed, but iteration will go on.
null filter means that all directories should be processed.
iterateContent in interface FileIndexContentIterator.processFile(VirtualFile) returned false)public boolean isInContent(VirtualFile fileOrDir)
FileIndextrue if fileOrDir is a file or directory under a content root of this project or module and not excluded or
ignored.isInContent in interface FileIndexpublic boolean isInSourceContent(VirtualFile fileOrDir)
FileIndextrue if fileOrDir is a file or directory located under a sources, tests or resources root and not excluded or ignored.isInSourceContent in interface FileIndexpublic java.util.List<OrderEntry> getOrderEntriesForFile(VirtualFile fileOrDir)
ModuleFileIndexgetOrderEntriesForFile in interface ModuleFileIndexfileOrDir - the file or directory to check.public OrderEntry getOrderEntryForFile(VirtualFile fileOrDir)
ModuleFileIndexgetOrderEntryForFile in interface ModuleFileIndexfileOrDir - the file or directory to check.public boolean isInTestSourceContent(VirtualFile fileOrDir)
FileIndexfileOrDir is a file or directory located under a test sources or resources root and not excluded or ignored.
Use this method when you really need to check whether the file is under test roots according to project configuration.
If you want to determine whether file should be considered as test (e.g. for implementing SearchScope)
you'd better use TestSourcesFilter.isTestSources(VirtualFile, Project) instead
which includes FileIndex.isInTestSourceContent(VirtualFile) invocation.
isInTestSourceContent in interface FileIndexTestSourcesFilter.isTestSources(VirtualFile, Project)public boolean isUnderSourceRootOfType(VirtualFile fileOrDir, java.util.Set<? extends JpsModuleSourceRootType<?>> rootTypes)
FileIndextrue if fileOrDir is a file or directory located under a source root of type from rootTypes set and not excluded or ignoredisUnderSourceRootOfType in interface FileIndexprotected boolean isScopeDisposed()
public static OrderEntry findOrderEntryWithOwnerModule(Module ownerModule, java.util.List<? extends OrderEntry> orderEntries)
protected boolean isInContent(VirtualFile file, DirectoryInfo info)
public boolean iterateContent(ContentIterator processor)
FileIndexiterateContent in interface FileIndexContentIterator.processFile(VirtualFile) returned false)public boolean iterateContentUnderDirectory(VirtualFile dir, ContentIterator processor, VirtualFileFilter customFilter)
FileIndexFileIndex.iterateContentUnderDirectory(VirtualFile, ContentIterator) but allows to pass additional customFilter to
the iterator, in case you need to skip some file system branches using your own logic. If customFilter returns false on
a directory, it won't be processed, but iteration will go on.
null filter means that all directories should be processed.
iterateContentUnderDirectory in interface FileIndexpublic boolean iterateContentUnderDirectory(VirtualFile dir, ContentIterator processor)
FileIndexdir (including the directory itself) skipping excluded
and ignored files and directories. Does nothing if dir is not in the content.iterateContentUnderDirectory in interface FileIndexContentIterator.processFile(VirtualFile) returned false)public DirectoryInfo getInfoForFileOrDirectory(VirtualFile file)
public boolean isContentSourceFile(VirtualFile file)
isContentSourceFile in interface FileIndex