blob: 7306b098fce534ea97af40734c822e4dea9801f9 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004, 2011 Tasktop Technologies and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.commons.sdk.util;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
/**
* @author Mik Kersten
*/
public class TestProject {
public IProject project;
public TestProject(final String name) throws CoreException, InvocationTargetException, InterruptedException {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
project = root.getProject(name);
project.create(null);
project.open(null);
}
public IProject getProject() {
return project;
}
public IFolder createFolder(String name) throws CoreException {
IFolder folder = project.getFolder(name);
folder.create(false, true, null);
return folder;
}
}