Skip to content

Conversation

RudreeshJoshi
Copy link

In the ValidateStandardTest.java file, I updated the file path in the getSpecsInArchive method to use the correct file separator, which was causing issues on certain systems. File schemasRoot = new File(src.getLocation().getPath(), ValidateStandard.SCHEMAS_RESOURCE_PATH); This way, the path will be created correctly for both Windows and Unix-like systems without causing issues with the path separator.

In the ValidateStandardTest.java file, I updated the file path in the `getSpecsInArchive` method to use the correct file separator, which was causing issues on certain systems.
File schemasRoot = new File(src.getLocation().getPath(), ValidateStandard.SCHEMAS_RESOURCE_PATH);
This way, the path will be created correctly for both Windows and Unix-like systems without causing issues with the path separator.
Copy link

google-cla bot commented May 10, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@itsankit-google itsankit-google added the build Triggers unit test build label Aug 20, 2025
Comment on lines +53 to +77
throws IOException, NoSuchAlgorithmException {
Map<String, Standard> schemas = new HashMap<>();
CodeSource src = ValidateStandard.class.getProtectionDomain().getCodeSource();
if (src != null) {
File schemasRoot =
new File(src.getLocation().getPath(), ValidateStandard.SCHEMAS_RESOURCE_PATH);

if (!schemasRoot.isDirectory()) {
throw new IOException(
String.format("Schemas root %s was not a directory", schemasRoot.getPath()));
}

String hash = calcHash(new FileInputStream(f));
schemas.put(
FilenameUtils.getBaseName(f.getName()),
new Standard(hash, FilenameUtils.getExtension(f.getName())));
for (File f : schemasRoot.listFiles()) {
if (f.toPath().endsWith(ValidateStandard.MANIFEST_PATH)) {
continue;
}

String hash = calcHash(new FileInputStream(f));
schemas.put(
FilenameUtils.getBaseName(f.getName()),
new Standard(hash, FilenameUtils.getExtension(f.getName())));
}
}

return schemas;
Copy link
Member

Choose a reason for hiding this comment

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

indentation issues, please address.

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

Successfully merging this pull request may close these issues.

2 participants