net.sourceforge.plantuml.file.AParentFolderRegular Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.file;
import java.io.IOException;
import net.sourceforge.plantuml.security.SFile;
public class AParentFolderRegular implements AParentFolder {
private final SFile dir;
public AParentFolderRegular(SFile dir) {
this.dir = dir;
// Log.info("Creating AParentFolderRegular " + dir);
}
@Override
public String toString() {
return "AParentFolderRegular::" + (dir == null ? "NULL" : dir.getPrintablePath());
}
public AFile getAFile(String nameOrPath) throws IOException {
final SFile filecurrent;
// Log.info("AParentFolderRegular::looking for " + nameOrPath);
// Log.info("AParentFolderRegular::dir = " + dir);
if (dir == null) {
filecurrent = new SFile(nameOrPath);
} else {
filecurrent = dir.getAbsoluteFile().file(nameOrPath);
}
// Log.info("AParentFolderRegular::Filecurrent " + filecurrent);
if (filecurrent.exists()) {
return new AFileRegular(filecurrent.getCanonicalFile());
}
return null;
}
}