private static void mkdirs(@Nonnull IResource resource, IProgressMonitor monitor) throws CoreException {
        IContainer container = resource.getParent();
        if (container.getType() == IResource.FOLDER && !container.exists()) {
            if(!container.getParent().exists()) {
                mkdirs(container, monitor);
            }
            ((IFolder) container).create(true, true, monitor);
        }
    }
private static void mkdirs ( @ Nonnull IResource resource , IProgressMonitor monitor ) throws CoreException { IContainer container = resource . getParent ( ) ; if ( container . getType ( ) == IResource . FOLDER && ! container . exists ( ) ) { if ( ! container . getParent ( ) . exists ( ) ) { mkdirs ( container , monitor ) ; } ( ( IFolder ) container ) . create ( true , true , monitor ) ; } }
Recursively creates all folders needed, up to the project. Project must
already exist.

@param resource
non null
@param monitor
non null
@throws CoreException