Skip to content
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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Fix/w 10673625 #193

wants to merge 6 commits into from

Conversation

acurci-at-mulesoft
Copy link
Contributor

No description provided.

@@ -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()) {

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"));

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:"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants