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

com.gitee.l0km.codegen.base.generator.FileBuilder Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
package com.gitee.l0km.codegen.base.generator;

import java.io.File;

import net.gdface.utils.Assert;

public class FileBuilder {
	public static final class Builder {
		private File file;

		private Builder(File file) {
			Assert.notNull(file, "file");
			this.file = file;
		}

		public Builder append(String path) {
			Assert.notNull(path, "path");
			if(!path.isEmpty())
				file = new File(file, path);
			return this;
		}

		public File build() {
			return file;
		}
	}

	public static final Builder from(String file) {
		Assert.notEmpty(file, "file");
		return from( new File(file));
	}

	public static final Builder from(File file) {
		return new Builder(file);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy