I'm chaining a few xslt Transformations in a jar using saxon 9 ee as a library. In my char I wan't to create the ouput directory which I do like this:
int timestamp = (int) System.currentTimeMillis();
File inputfolder = new File("input_ll_" + Math.abs(timestamp));
inputfolder.mkdir();
Then I tell Saxon to use that folder as output:
//output last transformation to file
transtemp.setDestination(getSerializer(inputfolder.toString()));
//start transformation
trans1.transform();
transtemp and trans one are both XsltTransformer Objects.
When I run my main method i get this:
Exception in thread "main" net.sf.saxon.s9api.SaxonApiException: java.io.FileNotFoundException: C:\Users\blabla\workspace\Tests\input_ll_1718557701 (Access Denied)
Any ideas ?
Update:
If i try to create a file there myself:
File check = new File(inputfolder.toString() + "/check.txt");
check.createNewFile();
it works, so it seems it's a problem with saxon ?
Update 2:
Yeah, classic me being stupid. I have to pass a path to a file not just to a directory.