class FileSystem {

	@Pure
	public static File join(File fileBase, String... elements) {
		if (fileBase == null) {
			return null;
		}
		final StringBuilder buf = new StringBuilder(fileBase.getPath());
		boolean empty;
		for (final String elt : elements) {
			empty = elt == null || elt.length() == 0;
			if (!empty) {
				assert elt != null;
				if (!elt.startsWith(File.separator)
						&& buf.length() >= 0
						&& buf.charAt(buf.length() - 1) != File.separatorChar) {
					buf.append(File.separatorChar);
				}
				buf.append(elt);
			}
		}
		return new File(buf.toString());
	}

	private  FileSystem();

}