public static boolean createFile(String directory, String name, FileType type, String moduleName, boolean isPublic, boolean withTests, boolean withHeader, boolean withSource, IOutput output)
    {
        // initial checks
        output.writeLine("Creating file '" + name + "'...");
        if (!FileUtils.isNameOk(name))
        {
            // name has invalid characters
            output.writeLine(String.format("    The filename '%s' is invalid.", name));
            return false;
        }
        name = FileUtils.removeExtension(name);

        File moduleDirFile = ACMEModule.determineModuleDirectory(directory, moduleName, true, output);
        if (moduleDirFile == null)
        {
            return false;
        }
        moduleName = moduleDirFile.getName();

        // do the work
        boolean creationHappend = false;
        if (withHeader)
        {
            if (headerExists(moduleDirFile, moduleName, name))
            {
                output.writeLine("    Skipping header because it seems to exist!");
            }
            else
            {
                writeHeader(moduleDirFile, name, moduleName, isPublic, type, output);
                creationHappend = true;
            }
        }
        isPublic = isPublicHeader(moduleDirFile, moduleName, name); // check if the header is public (maybe wrong if file already exists or was skipped by user)

        if (withSource)
        {
            if (sourceExists(moduleDirFile, moduleName, name, type))
            {
                output.writeLine("    Skipping source because it seems to exist!");
            }
            else
            {
                writeSource(moduleDirFile, name, moduleName, isPublic, type, output);
                creationHappend = true;
            }
        }
        if (withTests)
        {
            if (testsExists(moduleDirFile, moduleName, name, type))
            {
                output.writeLine("    Skipping tests because they seem to exist!");
            }
            else
            {
                writeTestHeader(moduleDirFile, name, moduleName, isPublic, output);
                writeTestSource(moduleDirFile, name, moduleName, isPublic, output);
                creationHappend = true;
            }
        }

        // finally, adjust CMakeLists.txt
        FileUtils.adjustModuleCMakeLists(moduleDirFile, name, creationHappend, output);

        // done
        return true;
    }