class ExecutionContextStackImpl implements ExecutionContextStack {

	@Override
	public String getAbsolutePath(final String path) {
		if (path.charAt(0) == '/') {
			return path;
		}

		if (!path.startsWith("./")) {
			return joinPath(getRootPath(), path);
		}

		if (isEmpty()) {
			throw new InvalidExecutionContextException("Relative path not allowed on top of ExecutionContext: " + path);
		}

		// remove "./" from path
		return joinPath(peek().getPath(), path.substring(2));
	}

	public  ExecutionContextStackImpl(final String rootPath);

}