mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CR-IC-3246#c17895 hide LocalFileUrl
This commit is contained in:
@@ -6,6 +6,9 @@ import org.jetbrains.annotations.Nullable;
|
||||
public final class LocalFileUrl implements Url {
|
||||
private final String path;
|
||||
|
||||
/**
|
||||
* Use {@link Urls#newLocalFileUrl(String)} instead
|
||||
*/
|
||||
public LocalFileUrl(@NotNull String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,16 @@ public final class Urls {
|
||||
return new UrlImpl(scheme, null, path);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Url newLocalFileUrl(@NotNull String path) {
|
||||
return new LocalFileUrl(path);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Url newLocalFileUrl(@NotNull VirtualFile file) {
|
||||
return newLocalFileUrl(file.getPath());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Url newFromEncoded(@NotNull String url) {
|
||||
Url result = parseEncoded(url);
|
||||
@@ -78,7 +88,7 @@ public final class Urls {
|
||||
// java.net.URI.create cannot parse "file:///Test Stuff" - but you don't need to worry about it - this method is aware
|
||||
@Nullable
|
||||
public static Url parseFromIdea(@NotNull String url) {
|
||||
return URLUtil.containsScheme(url) ? parseUrl(url) : new LocalFileUrl(url);
|
||||
return URLUtil.containsScheme(url) ? parseUrl(url) : newLocalFileUrl(url);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -89,7 +99,7 @@ public final class Urls {
|
||||
|
||||
if (asLocalIfNoScheme && !URLUtil.containsScheme(url)) {
|
||||
// nodejs debug — files only in local filesystem
|
||||
return new LocalFileUrl(url);
|
||||
return newLocalFileUrl(url);
|
||||
}
|
||||
return parseUrl(VfsUtilCore.toIdeaUrl(url));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user