-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/w 10673625 #193
base: main
Are you sure you want to change the base?
Fix/w 10673625 #193
Conversation
@@ -50,7 +51,7 @@ public static URI createUri(String basePath, String filePath) { | |||
String fullPath; | |||
try { | |||
if (filePath.length() > 0) { | |||
if (isAbsolute(filePath)) { | |||
if (isAbsolute(filePath) || basePath.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what will happen if the filePath is not an absolute path and the basePath is empty? will the URI constructor throw an exception?
public void bothConstructorWithBasePathAssignInSpecificFolderWithSeparator2() { | ||
ConcreteFileAttributes pathAttributes = new ConcreteFileAttributes(Paths.get("/myFile.txt")); | ||
// Basepath parameter will be ignored when tne filepath is absolute (when it start with slash) | ||
ConcreteFileAttributes uriAttributes = new ConcreteFileAttributes(createUri("/root/", "/myFile.txt")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case I would expect the result as "/root/myfile.txt", the condition to check if the path is absolute checks only that the filePath started with a "/" but that doesn't mean that the path is absolute right? in Unix I would expect a "~/" to determine that the path is absolute and in Windows I would expect a "X:"
No description provided.