diff --git a/src/main/java/net/schmizz/sshj/xfer/FileSystemFile.java b/src/main/java/net/schmizz/sshj/xfer/FileSystemFile.java index 83d5a2614..b759f9cb0 100644 --- a/src/main/java/net/schmizz/sshj/xfer/FileSystemFile.java +++ b/src/main/java/net/schmizz/sshj/xfer/FileSystemFile.java @@ -162,12 +162,12 @@ private void validateIsChildPath(String name) { String[] split = name.split("/"); Stack s = new Stack(); for (String component : split) { - if (component == null || component.isEmpty() || component.equals(".")) { + if (component == null || component.isEmpty() || ".".equals(component)) { continue; - } else if (component.equals("..") && !s.isEmpty()) { + } else if ("..".equals(component) && !s.isEmpty()) { s.pop(); continue; - } else if (component.equals("..")) { + } else if ("..".equals(component)) { throw new IllegalArgumentException("Cannot traverse higher than " + file + " to get child " + name); } s.push(component);