Thursday, December 19, 2013

Re: GeneratorContext.tryCreateResource

The following commit changed the behavior:

Java's mkdir() / mkdirs() do not work as expected with directories containing "/../", so I think the correct way would have been to do dir = dir.getCanonicalFile() before calling dir.mkdir(). The implementation before that commit simply ignores the return value of dir.mkdir() which in turn means it has ignored the failed creation of directory "/path/to/folder/..". So the programming bug has kind of cured itself because of the recursive behavior of OutputFileSetOnDirectory.mkdirs().

Looks pretty similar to what I have done in

Please file a bug so it gets fixed for 2.6 or 2.6.1.

-- J.

Am Donnerstag, 19. Dezember 2013 22:09:16 UTC+1 schrieb Douglas Hoskins:

Done a bit more research -- the path I am trying to create is in the form /path/to/folder1/../folder2/filename.ext

It seems that the failure is happening on processing the ".." part:

[ERROR] Fatal error emitting artifact: ../folder2/filename.ext unable to create directory: /path/to/folder1/..


On Thursday, 19 December 2013 18:03:38 UTC, Douglas Hoskins wrote:
I have just upgraded my project from 2.5.1 to 2.6.0-rc3.  I have some Generators in my project that create new files in the file system using GeneratorContext.tryCreateResource.

This used to work fine even if the target directory for the file did not exist, but now in 2.6.0-rc3 it is throwing an IOException: unable to create directory.

I will step through the GWT code at some point to find out what the reason is, but has something changed to prevent GeneratorContext being able to create new folders since 2.5.1?


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment