1 package com.proalpha.pds.templates.helper;
3 import org.eclipse.core.resources.IFile;
4 import org.eclipse.core.resources.IFolder;
5 import org.eclipse.core.runtime.CoreException;
6 import org.eclipse.core.runtime.NullProgressMonitor;
24 private static void createFolderRecursively(
final IFolder path)
throws CoreException {
27 if (!path.getParent().exists())
28 createFolderRecursively((IFolder) path.getParent());
30 path.create(
true,
true,
new NullProgressMonitor());
35 public static IFolder createNewFoldersInWorkingDirectory(
36 IFolder workingDirectory, String path)
throws Exception {
38 IFolder fullPath = workingDirectory.getFolder(path);
40 if (!fullPath.exists()) {
41 createFolderRecursively(fullPath);
47 public static IFile createFileInWorkingDirectory(IFolder workingDirectory, String relativePath,
48 String fileName)
throws Exception {
50 workingDirectory = createNewFoldersInWorkingDirectory(workingDirectory
53 return workingDirectory.getFile(fileName);