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

assumes seed unless .xml input file? #95

Closed
crotwell opened this issue Jan 21, 2020 · 2 comments
Closed

assumes seed unless .xml input file? #95

crotwell opened this issue Jan 21, 2020 · 2 comments

Comments

@crotwell
Copy link
Contributor

This seems to work fine:

java -jar stationxml-validator-1.6.0.2-SNAPSHOT.jar  testdata/CO_JSC.xml --string
PASSED

But if I

cp testdata/CO_JSC.xml testdata/CO_JSC.staxml

java -jar stationxml-validator-1.6.0.2-SNAPSHOT.jar  testdata/CO_JSC.staxml --string
java.lang.RuntimeException: java.io.IOException: Error calculation record length!
	at edu.iris.dmc.seed.blockette.util.BlocketteItrator.hasNext(BlocketteItrator.java:58)
	at edu.iris.dmc.IrisUtil.readSeed(IrisUtil.java:62)
	at edu.iris.dmc.IrisUtil.readSeed(IrisUtil.java:54)
	at edu.iris.dmc.Application.read(Application.java:158)
	at edu.iris.dmc.Application.run(Application.java:130)
	at edu.iris.dmc.Application.run(Application.java:121)
	at edu.iris.dmc.Application.main(Application.java:92)
Caused by: java.io.IOException: Error calculation record length!
	at edu.iris.dmc.seed.io.RecordInputStream.getRecordLength(RecordInputStream.java:99)
	at edu.iris.dmc.seed.io.RecordInputStream.next(RecordInputStream.java:32)
	at edu.iris.dmc.seed.blockette.util.BlocketteItrator.hasNext(BlocketteItrator.java:45)
	... 6 more

Same file, but it appears that if the file doesn't end in .xml it reads it as SEED. Seems weird that the default would be to read dataless within a stationxml validator???

If there are more than one type of input file allowed, it would be nice to have a cmd line arg to say what it is, maybe --staxml and --'seed' like:

java -jar stationxml-validator-1.6.0.2-SNAPSHOT.jar  --staxml testdata/CO_JSC.staxml --string

Guessing file types based off of file extensions is kind of dangerous and forcing naming as .xml is too restrictive.

@timronan
Copy link
Collaborator

timronan commented Apr 27, 2020

This issue has been addressed by validator version stationxml-validator-1.7.0-RC-01. Please download this jar on the project's release page and verify that this function works satisfactorily. Report or close this issue based on your findings.

Refer to commit: 26da017

@crotwell
Copy link
Contributor Author

seems to work ok, closing

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

No branches or pull requests

2 participants