mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
post review: rename to WebServerRootsProvider
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ import com.intellij.util.PairFunction;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
final class ArtifactProjectRootsProvider extends ProjectRootsProvider.PrefixlessProjectRootsProvider {
|
||||
final class ArtifactProjectRootsProvider extends WebServerRootsProvider.PrefixlessProjectRootsProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public Pair<VirtualFile, Pair<VirtualFile, String>> resolve(@NotNull String path, @NotNull Project project, @NotNull PairFunction<String, VirtualFile, VirtualFile> resolver) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.intellij.util.PlatformUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
final class ProjectRootsProviderImpl extends ProjectRootsProvider {
|
||||
final class ProjectRootsProviderImpl extends WebServerRootsProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public Pair<VirtualFile, Pair<VirtualFile, String>> resolve(@NotNull String path, @NotNull Project project) {
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.net.URI;
|
||||
|
||||
/**
|
||||
* By default {@link WebServerPathToFileManager} will be used to map request to file.
|
||||
* If file physically exists in the file system, you must use {@link org.jetbrains.builtInWebServer.ProjectRootsProvider}.
|
||||
* If file physically exists in the file system, you must use {@link WebServerRootsProvider}.
|
||||
*
|
||||
* Consider to extend {@link WebServerPathHandlerAdapter} instead of implement low-level {@link #process(String, com.intellij.openapi.project.Project, io.netty.handler.codec.http.FullHttpRequest, io.netty.channel.Channel, String, String, boolean)}
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Implement {@link org.jetbrains.builtInWebServer.ProjectRootsProvider} to add your provider
|
||||
* Implement {@link WebServerRootsProvider} to add your provider
|
||||
*/
|
||||
public class WebServerPathToFileManager {
|
||||
private static final PairFunction<String, VirtualFile, VirtualFile> RELATIVE_PATH_RESOLVER = new PairFunction<String, VirtualFile, VirtualFile>() {
|
||||
@@ -60,7 +60,7 @@ public class WebServerPathToFileManager {
|
||||
for (VFileEvent event : events) {
|
||||
if (event instanceof VFileContentChangeEvent) {
|
||||
VirtualFile file = ((VFileContentChangeEvent)event).getFile();
|
||||
for (ProjectRootsProvider rootsProvider : ProjectRootsProvider.EP_NAME.getExtensions()) {
|
||||
for (WebServerRootsProvider rootsProvider : WebServerRootsProvider.EP_NAME.getExtensions()) {
|
||||
if (rootsProvider.isClearCacheOnFileContentChanged(file)) {
|
||||
clearCache();
|
||||
break;
|
||||
@@ -119,7 +119,7 @@ public class WebServerPathToFileManager {
|
||||
public Pair<VirtualFile, String> getRoot(@NotNull VirtualFile child) {
|
||||
Pair<VirtualFile, String> result = fileToRoot.getIfPresent(child);
|
||||
if (result == null) {
|
||||
for (ProjectRootsProvider rootsProvider : ProjectRootsProvider.EP_NAME.getExtensions()) {
|
||||
for (WebServerRootsProvider rootsProvider : WebServerRootsProvider.EP_NAME.getExtensions()) {
|
||||
result = rootsProvider.getRoot(child, project);
|
||||
if (result != null) {
|
||||
fileToRoot.put(child, result);
|
||||
@@ -132,7 +132,7 @@ public class WebServerPathToFileManager {
|
||||
|
||||
@Nullable
|
||||
VirtualFile findByRelativePath(@NotNull Project project, @NotNull String path) {
|
||||
for (ProjectRootsProvider rootsProvider : ProjectRootsProvider.EP_NAME.getExtensions()) {
|
||||
for (WebServerRootsProvider rootsProvider : WebServerRootsProvider.EP_NAME.getExtensions()) {
|
||||
Pair<VirtualFile, Pair<VirtualFile, String>> result = rootsProvider.resolve(path, project);
|
||||
if (result != null) {
|
||||
fileToRoot.put(result.first, result.second);
|
||||
|
||||
+3
-3
@@ -8,8 +8,8 @@ import com.intellij.util.PairFunction;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class ProjectRootsProvider {
|
||||
static final ExtensionPointName<ProjectRootsProvider> EP_NAME = ExtensionPointName.create("org.jetbrains.webServerProjectRootsProvider");
|
||||
public abstract class WebServerRootsProvider {
|
||||
static final ExtensionPointName<WebServerRootsProvider> EP_NAME = ExtensionPointName.create("org.jetbrains.webServerProjectRootsProvider");
|
||||
|
||||
@Nullable
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ public abstract class ProjectRootsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract static class PrefixlessProjectRootsProvider extends ProjectRootsProvider {
|
||||
public abstract static class PrefixlessProjectRootsProvider extends WebServerRootsProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public final Pair<VirtualFile, Pair<VirtualFile, String>> resolve(@NotNull String path, @NotNull Project project) {
|
||||
Reference in New Issue
Block a user