public final class ExtensionsRootType extends RootType
Extensions root type provide a common interface for plugins to access resources that are modifiable by the user.
Plugin's resources are stored in a directory named %plugin-id% under extensions root.
Plugins can bundle default resources. Bundled resources are searched via ClassLoader.getResources(String)
call to plugin's class loader passing EXTENSIONS_PATH
concatenated with relative resource path as an argument.
Bundled resources are updated automatically upon plugin version change. For bundled plugins, application version is used.
Modifier and Type | Method and Description |
---|---|
void |
extractBundledResources(PluginId pluginId,
java.lang.String path) |
java.io.File |
findResource(PluginId pluginId,
java.lang.String path) |
java.io.File |
findResourceDirectory(PluginId pluginId,
java.lang.String path,
boolean createIfMissing) |
static ExtensionsRootType |
getInstance() |
PluginId |
getOwner(VirtualFile resource) |
boolean |
isResourceFile(java.io.File file) |
static Condition<java.io.File> |
regularFileFilter() |
java.lang.String |
substituteName(Project project,
VirtualFile file) |
containsFile, fileClosed, fileOpened, findByClass, findById, findFile, forFile, getAllRootTypes, getDisplayName, getId, isHidden, isIgnored, registerTreeUpdater, substituteIcon, substituteLanguage
public static ExtensionsRootType getInstance()
public static Condition<java.io.File> regularFileFilter()
public PluginId getOwner(VirtualFile resource)
public java.io.File findResource(PluginId pluginId, java.lang.String path) throws java.io.IOException
java.io.IOException
public java.io.File findResourceDirectory(PluginId pluginId, java.lang.String path, boolean createIfMissing) throws java.io.IOException
java.io.IOException
public void extractBundledResources(PluginId pluginId, java.lang.String path) throws java.io.IOException
java.io.IOException
public java.lang.String substituteName(Project project, VirtualFile file)
substituteName
in class RootType
public boolean isResourceFile(java.io.File file)