Issue with folder creation (Operator.getParameterAsFile)

colocolo Member Posts: 236 Guru
edited November 2018 in Help

I was just wondering, why the web crawler doesn't automatically generate folders required for the specified output location.

CrawlerOperator calls the method getParameterAsFile(String key, boolean createMissingDirectories) with the second parameter set to true. Having a look at the method from class Operator revealed the problem:

public getParameterAsFile(String key, boolean createMissingDirectories) throws UndefinedParameterError {
        String fileName = getParameter(key);
        if (process != null) {
            File result = process.resolveFileName(fileName);
            if (createMissingDirectories) {
                if (result.isDirectory()) {
                } else {
                    File parent = result.getParentFile();
                    if (parent != null)
            return result;
Since the directory is not existing at the time where this code starts being executed, result.isDirectory() will always return false (this is at least the case on my Windows machine). As soon as the directory exists, it is correctly recognized as directory, but that doesn't help much in case where I want it to be created.

I will solve this with a temporary workaround for now. But if you can confirm the issue, you probably might want to fix this.

Best regards


  • Marco_BoeckMarco_Boeck Team Lead Software Engineering Administrator, Moderator, Employee, Member, University Professor Posts: 1,965 RM Engineering

    I'm afraid I have to ask you again to file a bug report on the issue..

  • colocolo Member Posts: 236 Guru
    Hi Marco,

    last time your answer was much more appreciated ;) I created all the bugs you asked for.

    I'm wondering about my chance of becoming "Bug Filer of the Week"... there are four up to now, don't know if this will be enough :D

Sign In or Register to comment.