-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update ValidateStandardTest.java #996
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
base: develop
Are you sure you want to change the base?
Conversation
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.
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. |
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; |
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.
indentation issues, please address.
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.