private static void ensureExists(IContainer container, IProgressMonitor monitor) throws CoreException { if (container.exists()) return; if (!(container instanceof IFolder)) throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, "not a folder: "+container)); //$NON-NLS-1$ IContainer parent= container.getParent(); if (parent instanceof IFolder) { ensureExists(parent, monitor); } ((IFolder) container).create(false, true, monitor); }
/** * @param container * @return */ private boolean isExcluded(IContainer container) { if( container == null || excludedDirRegExes == null || excludedDirRegExes.isEmpty() ) return false; return ResourceCollector.isResourceExcluded(container, excludedDirRegExes) || isExcluded(container.getParent()); }
private static void ensureExists(IContainer container, IProgressMonitor monitor) throws CoreException { if (container.exists()) return; if (!(container instanceof IFolder)) throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, "not a folder: "+container)); //$NON-NLS-1$ IContainer parent= container.getParent(); if (parent instanceof IFolder) { ensureExists(parent, monitor); } ((IFolder) container).create(false, true, monitor); }
public boolean isUnderVirtual() { IContainer parent = getParent(); while (parent != null) { if (parent.isVirtual()) return true; parent = parent.getParent(); } return false; }
public boolean isUnderVirtual() { IContainer parent = getParent(); while (parent != null) { if (parent.isVirtual()) return true; parent = parent.getParent(); } return false; }
private void createOutputFolder(IContainer outputFolder) throws CoreException { createParentFolder(outputFolder.getParent()); ((IFolder) outputFolder).create(IResource.FORCE | IResource.DERIVED, true, null); }
protected void ensureExists(IContainer parent) { if (parent instanceof IFolder && !parent.exists()) { ensureExists(parent.getParent()); try { ((IFolder) parent).create(true, true, null); } catch (CoreException e) { throw new RuntimeException(e); } } }
protected void createFolder(IContainer parent) throws CoreException { if(!parent.exists()) { if(!(parent instanceof IFolder)) throw new RuntimeException("IContainer " + notNull(parent) + " does not exist"); createFolder(parent.getParent()); ((IFolder)parent).create(true, false, new NullProgressMonitor()); } }
protected void ensureExists(IContainer container) throws CoreException { if (container.exists()) return; if (container instanceof IFolder) { ensureExists(container.getParent()); ((IFolder)container).create(true, true, monitor); } }
protected void deleteEmptyParent(IProgressMonitor monitor, IContainer container) throws CoreException { final IContainer parent = container.getParent(); if (container.members().length == 0) { container.delete(true, monitor); deleteEmptyParent(monitor, parent); } }
private void createParentFolder(IContainer parent) throws CoreException { if (!parent.exists()) { createParentFolder(parent.getParent()); ((IFolder) parent).create(true, true, null); } }
private void createParentFolder(IContainer parent) throws CoreException { if (!parent.exists()) { createParentFolder(parent.getParent()); ((IFolder) parent).create(true, true, null); } }
private void createParentFolder(IContainer parent) throws CoreException { if (!parent.exists()) { createParentFolder(parent.getParent()); ((IFolder) parent).create(true, true, null); } }
protected void createImportedClassesFolder() { importedClassesFolderCreated = true; IContainer jarParent = vComponent.getRootFolder().getUnderlyingFolder().getParent(); importedClassesFolder = jarParent.getFolder(new Path(IMPORTED_CLASSES)); try { importedClassesFolder.create(true, true, null); } catch (CoreException e1) { Logger.getLogger().logError(e1); } }
protected void createImportedClassesFolder() { importedClassesFolderCreated = true; IContainer jarParent = vComponent.getRootFolder().getUnderlyingFolder().getParent(); importedClassesFolder = jarParent.getFolder(new Path(IMPORTED_CLASSES)); try { importedClassesFolder.create(true, true, null); } catch (CoreException e1) { Logger.getLogger().logError(e1); } }
protected void createIncludingParents(IContainer container) { while (container != null && !(container.exists() || getResourceModifications().willExist(container))) { getResourceModifications().addCreate(container); container= container.getParent(); } }
protected void createIncludingParents(IContainer container) { while (container != null && !(container.exists() || getResourceModifications().willExist(container))) { getResourceModifications().addCreate(container); container= container.getParent(); } }
protected void createIncludingParents(IContainer container) { while (container != null && !(container.exists() || getResourceModifications().willExist(container))) { getResourceModifications().addCreate(container); container= container.getParent(); } }
public static void createFolders(IContainer folder, IProgressMonitor monitor) throws CoreException { if (!folder.exists() && folder instanceof IFolder) { IContainer parent = folder.getParent(); createFolders(parent, monitor); folder.refreshLocal(IResource.DEPTH_ZERO, monitor); if (!folder.exists()) { ((IFolder)folder).create(true, true, monitor); } } }