diff options
Diffstat (limited to 'platform/platform-impl/src/com/intellij/remote/RemoteFile.java')
-rw-r--r-- | platform/platform-impl/src/com/intellij/remote/RemoteFile.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/platform-impl/src/com/intellij/remote/RemoteFile.java b/platform/platform-impl/src/com/intellij/remote/RemoteFile.java index 4a2e11379364..724ec31fe1ef 100644 --- a/platform/platform-impl/src/com/intellij/remote/RemoteFile.java +++ b/platform/platform-impl/src/com/intellij/remote/RemoteFile.java @@ -2,7 +2,6 @@ package com.intellij.remote; import com.intellij.openapi.util.io.FileUtil; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * @author traff @@ -25,14 +24,14 @@ public class RemoteFile { this(resolveChild(parent, child, isWin), isWin); } - @Nullable + @NotNull public String getName() { int ind = myPath.lastIndexOf(getSeparator(myWin)); if (ind != -1 && ind < myPath.length() - 1) { //not last char return myPath.substring(ind + 1); } else { - return null; + return myPath; } } @@ -88,6 +87,10 @@ public class RemoteFile { return detectSystemByPath(path).createRemoteFile(path, script); } + public static RemoteFile createRemoteFile(String path) { + return detectSystemByPath(path).createRemoteFile(path); + } + public static RemoteFile createRemoteFile(final String path, final String script, final boolean isWindows) { return new RemoteFileBuilder(isWindows).createRemoteFile(path, script); } |