mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-08 16:18:05 +03:00
Fixed codacy
This commit is contained in:
@@ -162,12 +162,12 @@ public class FileSystemFile
|
|||||||
String[] split = name.split("/");
|
String[] split = name.split("/");
|
||||||
Stack<String> s = new Stack<String>();
|
Stack<String> s = new Stack<String>();
|
||||||
for (String component : split) {
|
for (String component : split) {
|
||||||
if (component == null || component.isEmpty() || component.equals(".")) {
|
if (component == null || component.isEmpty() || ".".equals(component)) {
|
||||||
continue;
|
continue;
|
||||||
} else if (component.equals("..") && !s.isEmpty()) {
|
} else if ("..".equals(component) && !s.isEmpty()) {
|
||||||
s.pop();
|
s.pop();
|
||||||
continue;
|
continue;
|
||||||
} else if (component.equals("..")) {
|
} else if ("..".equals(component)) {
|
||||||
throw new IllegalArgumentException("Cannot traverse higher than " + file + " to get child " + name);
|
throw new IllegalArgumentException("Cannot traverse higher than " + file + " to get child " + name);
|
||||||
}
|
}
|
||||||
s.push(component);
|
s.push(component);
|
||||||
|
|||||||
Reference in New Issue
Block a user