All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.SourceFileReaderCopyCat Maven / Gradle / Ivy

There is a newer version: 1.2025.0
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml;

import java.io.File;
import java.io.IOException;
import java.util.List;

import net.sourceforge.plantuml.file.SuggestedFile;
import net.sourceforge.plantuml.preproc.Defines;

public class SourceFileReaderCopyCat extends SourceFileReaderAbstract implements ISourceFileReader {
	// ::remove file when __CORE__
	// ::remove file when __HAXE__

	private final File outputDirectory;

	public SourceFileReaderCopyCat(Defines defines, final File file, File outputDirectory, List config,
			String charset, FileFormatOption fileFormatOption) throws IOException {
		super(file, fileFormatOption, defines, config, charset);
		final String path = file.getParentFile().getPath();
		this.outputDirectory = new File(outputDirectory, path).getAbsoluteFile();
		if (outputDirectory.exists() == false)
			outputDirectory.mkdirs();
	}

	@Override
	protected SuggestedFile getSuggestedFile(BlockUml blockUml) {
		String newName = blockUml.getFileOrDirname();
		if (newName == null)
			newName = getFileName();
		final SuggestedFile suggested = getSuggestedFile(outputDirectory, newName);
		suggested.getParentFile().mkdirs();
		return suggested;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy