Skip to content

fix path for multi-platform#304

Open
PayalKhanna wants to merge 6 commits into
finos:mainfrom
REGnosys:path-fix
Open

fix path for multi-platform#304
PayalKhanna wants to merge 6 commits into
finos:mainfrom
REGnosys:path-fix

Conversation

@PayalKhanna
Copy link
Copy Markdown
Contributor

No description provided.

@PayalKhanna PayalKhanna changed the title fix path for multi-platform [master[ fix path for multi-platform Apr 13, 2026
@PayalKhanna PayalKhanna changed the title [master[ fix path for multi-platform fix path for multi-platform Apr 13, 2026
String displayName = baseFileName.replace("-", " ");

TestPackModel.SampleModel sampleModel = new TestPackModel.SampleModel(baseFileName.toLowerCase(), displayName, inputSample.toString(), outputPath.toString(), assertions);
TestPackModel.SampleModel sampleModel = new TestPackModel.SampleModel(baseFileName.toLowerCase(), displayName, inputSample.toString().replace('\\', '/'), outputPath.toString().replace('\\', '/'), assertions);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use UrlUtils.toPortableString(inputSample) and UrlUtils.toPortableString(outputPath) instead

Path parent = samplePath.getParent();
Path relativePath = resourcesPath.relativize(inputPath).relativize(parent);
return relativePath.toString().replace(File.separatorChar, '-');
return relativePath.toString().replace('\\', '/').replace('/', '-');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be UrlUtils.toPortableString(relativePath).replace(File.separatorChar, '-')?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will try tthis


protected String getFileName(String path) {
return path.substring(path.lastIndexOf('/') + 1);
return path.substring(Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\')) + 1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this one about?


private String toJavaFile(String className) {
return className.replace(".", File.separator) + ".java";
return className.replace(".", "/") + ".java";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought File.separator worked across platforms?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

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