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

bug when inputFile has no extension #41

Open
karrayhamdi opened this issue Sep 11, 2018 · 2 comments
Open

bug when inputFile has no extension #41

karrayhamdi opened this issue Sep 11, 2018 · 2 comments

Comments

@karrayhamdi
Copy link

Hi,

i find a bug when the input has no extension (the ix gives -1) :

private String getFileName(File sourceFile, HashMap<QName,ParameterValue> parameters) {
String filename = (prefix!=null?prefix:"") + name + (suffix!=null?suffix:"");
String sourceName = sourceFile.getName();
int ix = sourceName.lastIndexOf(".");
// FIXME: this shouldn't be supported, it has been replaced by input-* pseudo-variables
String extension = sourceName.substring(ix);
String basename = sourceName.substring(0, ix);
String ret = filename.replaceAll("\$\{name\}", sourceName).replaceAll("\$\{basename\}", basename).replaceAll("\$\{extension\}", extension);
for(ParameterValue pv:parameters.values()) {
if(pv.getValue() instanceof String || pv.getValue() instanceof XdmAtomicValue) {
ret = ret.replaceAll("\$\["+pv.getKey()+"\]", pv.getValue().toString());
}
}
return ret;
}

@cmarchand
Copy link
Owner

What a bad idea not to have an extension !
;-)

But you are right, this is a bug. Which release do you use ?

Christophe

@karrayhamdi
Copy link
Author

Yes it is :) In my case i have created a temp file with expath extension and by default, this has no extension.

1.03.04 for the release version

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