public void convert()

in src/main/java/org/apache/maven/doxia/DefaultConverter.java [326:373]


    public void convert(InputFileWrapper input, OutputFileWrapper output)
            throws UnsupportedFormatException, ConverterException {
        Objects.requireNonNull(input, "input is required");
        Objects.requireNonNull(output, "output is required");

        try {
            startPlexusContainer();
        } catch (PlexusContainerException e) {
            throw new ConverterException("PlexusContainerException: " + e.getMessage(), e);
        }
        outputRenameMap.clear();
        try {
            if (input.getFile().isFile()) {
                convert(input.getFile(), input.getEncoding(), input.getFormat(), output);
            } else {
                List<File> files;
                try {
                    files = FileUtils.getFiles(
                            input.getFile(),
                            "**/*." + input.getFormat().getExtension(),
                            StringUtils.join(FileUtils.getDefaultExcludes(), ", "));
                } catch (IOException e) {
                    throw new ConverterException("IOException: " + e.getMessage(), e);
                } catch (IllegalStateException e) {
                    throw new ConverterException("IllegalStateException: " + e.getMessage(), e);
                }
                if (files.isEmpty()) {
                    throw new ConverterException("ConverterException: No files with extension "
                            + input.getFormat().getExtension() + " found in directory " + input.getFile());
                }
                for (File f : files) {
                    File relativeOutputDirectory = new File(
                            PathTool.getRelativeFilePath(input.getFile().getAbsolutePath(), f.getParent()));
                    convert(f, input.getEncoding(), input.getFormat(), output, relativeOutputDirectory);
                }
            }
            try {
                postProcessAllFiles(output.getFormat());
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new ConverterException("Error post processing all files: " + e.getMessage(), e);
            } catch (IOException e) {
                throw new ConverterException("Error post processing all files: " + e.getMessage(), e);
            }
        } finally {
            stopPlexusContainer();
        }
    }