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); }
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 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); } } }
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()); } }
private void updateReadOnlyPackageFragmentsForCopy(IContainer sourceFolder, PackageFragmentRoot root, String[] newFragName) { IContainer parentFolder = (IContainer) root.resource(); for (int i = 0, length = newFragName.length; i <length; i++) { String subFolderName = newFragName[i]; parentFolder = parentFolder.getFolder(new Path(subFolderName)); sourceFolder = sourceFolder.getFolder(new Path(subFolderName)); if (sourceFolder.exists() && Util.isReadOnly(sourceFolder)) { Util.setReadOnly(parentFolder, true); } } }
public boolean visit(IDiff delta){ IResource treeResource = ResourceDiffTree.getResourceFor(delta); if (treeResource.getType()==IResource.FILE && !treeResource.getParent().exists()){ found[0] = true; return false; } return true; }}, IResource.DEPTH_INFINITE); return found[0];
private void updateReadOnlyPackageFragmentsForCopy(IContainer sourceFolder, PackageFragmentRoot root, String[] newFragName) { IContainer parentFolder = (IContainer) root.resource(); for (int i = 0, length = newFragName.length; i <length; i++) { String subFolderName = newFragName[i]; parentFolder = parentFolder.getFolder(new Path(subFolderName)); sourceFolder = sourceFolder.getFolder(new Path(subFolderName)); if (sourceFolder.exists() && Util.isReadOnly(sourceFolder)) { Util.setReadOnly(parentFolder, true); } } }
private void createParentFolder(IContainer parent) throws CoreException { if (!parent.exists()) { createParentFolder(parent.getParent()); ((IFolder) parent).create(true, true, null); } }
private void updateReadOnlyPackageFragmentsForCopy(IContainer sourceFolder, PackageFragmentRoot root, String[] newFragName) { IContainer parentFolder = (IContainer) root.resource(); for (int i = 0, length = newFragName.length; i <length; i++) { String subFolderName = newFragName[i]; parentFolder = parentFolder.getFolder(new Path(subFolderName)); sourceFolder = sourceFolder.getFolder(new Path(subFolderName)); if (sourceFolder.exists() && Util.isReadOnly(sourceFolder)) { Util.setReadOnly(parentFolder, true); } } }
private void createParentFolder(IContainer parent) throws CoreException { if (!parent.exists()) { createParentFolder(parent.getParent()); ((IFolder) parent).create(true, true, null); } }
@Override public boolean visit(IDiff delta){ IResource treeResource = ResourceDiffTree.getResourceFor(delta); if (treeResource.getType()==IResource.FILE && !treeResource.getParent().exists()){ found[0] = true; return false; } return true; }}, IResource.DEPTH_INFINITE); return found[0];
private void updateReadOnlyPackageFragmentsForCopy(IContainer sourceFolder, PackageFragmentRoot root, String[] newFragName) { IContainer parentFolder = (IContainer) root.resource(); for (int i = 0, length = newFragName.length; i <length; i++) { String subFolderName = newFragName[i]; parentFolder = parentFolder.getFolder(new Path(subFolderName)); sourceFolder = sourceFolder.getFolder(new Path(subFolderName)); if (sourceFolder.exists() && Util.isReadOnly(sourceFolder)) { Util.setReadOnly(parentFolder, true); } } }
protected void ensureExists(IContainer container) throws CoreException { if (container.exists()) return; if (container instanceof IFolder) { ensureExists(container.getParent()); ((IFolder)container).create(true, true, monitor); } }
@Override public boolean visit(IDiff delta){ IResource treeResource = ResourceDiffTree.getResourceFor(delta); if (treeResource.getType()==IResource.FILE && !treeResource.getParent().exists()){ found[0] = true; return false; } return true; }}, IResource.DEPTH_INFINITE); return found[0];
private void createParentFolder(IContainer parent) throws CoreException { if (!parent.exists()) { createParentFolder(parent.getParent()); ((IFolder) parent).create(true, true, null); } }
public static void createFolder(IFolder folder, IProgressMonitor monitor) throws CoreException { IContainer container = folder.getParent(); if (container != null && !container.exists() && (container instanceof IFolder)) createFolder((IFolder) container, monitor); if (!folder.exists()) { folder.create(true, true, monitor); } }
protected void createIncludingParents(IContainer container) { while (container != null && !(container.exists() || getResourceModifications().willExist(container))) { getResourceModifications().addCreate(container); container= container.getParent(); } }
public static void mkdirs(IResource resource, IProgressMonitor monitor) throws CoreException { IContainer parent = resource.getParent(); if (!parent.exists()) { mkdirs(resource.getParent(), monitor); } if (resource instanceof IFolder && !resource.exists()) ((IFolder)resource).create(true, true, monitor); }