Skip to content

Commit

Permalink
Fixed codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
hierynomus committed Aug 22, 2017
1 parent 1f6615b commit 8856aae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/net/schmizz/sshj/xfer/FileSystemFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ private void validateIsChildPath(String name) {
String[] split = name.split("/");
Stack<String> s = new Stack<String>();
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);
Expand Down

0 comments on commit 8856aae

Please sign in to comment.