Java Code Examples for org.eclipse.core.resources.IFolder#isAccessible()
The following examples show how to use
org.eclipse.core.resources.IFolder#isAccessible() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PreviewTranslationHandler.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
/** * 得到子文件 * @param folder * 文件夹 * @param fileExtension * 子文件后缀名 * @param list * 子文件集合 * @throws CoreException * ; */ public static void getChildFiles(IFolder folder, String fileExtension, List<IFile> list) throws CoreException { if (list == null) { list = new ArrayList<IFile>(); } if (folder.isAccessible() && folder.exists()) { IResource[] members = folder.members(); for (IResource resource : members) { if (resource instanceof IFile && (fileExtension).equalsIgnoreCase(resource.getFileExtension())) { list.add((IFile) resource); } else if (resource instanceof IFolder) { getChildFiles((IFolder) resource, fileExtension, list); } } } }
Example 2
Source File: PreviewTranslationHandler.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
/** * 得到子文件 * @param folder * 文件夹 * @param fileExtension * 子文件后缀名 * @param list * 子文件集合 * @throws CoreException * ; */ public static void getChildFiles(IFolder folder, String fileExtension, List<IFile> list) throws CoreException { if (list == null) { list = new ArrayList<IFile>(); } if (folder.isAccessible() && folder.exists()) { IResource[] members = folder.members(); for (IResource resource : members) { if (resource instanceof IFile && (fileExtension).equalsIgnoreCase(resource.getFileExtension())) { list.add((IFile) resource); } else if (resource instanceof IFolder) { getChildFiles((IFolder) resource, fileExtension, list); } } } }
Example 3
Source File: WebArtifactRepositoryStore.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override public List<T> getChildren() { refresh(); final List<T> result = new ArrayList<>(); final IFolder folder = getResource(); if(!folder.exists() || !folder.isAccessible()) { return result; } try { for (final IResource r : folder.members()) { if (!r.isHidden() && !r.getName().startsWith(".") && r instanceof IFolder) { IResource jsonDescriptorFile = ((IFolder) r).findMember(r.getName() + ".json"); if (jsonDescriptorFile != null && jsonDescriptorFile.exists()) { result.add(createRepositoryFileStore(r.getName())); } } } } catch (final CoreException e) { BonitaStudioLog.error(e); } return result; }
Example 4
Source File: DriverProcessor.java From neoscada with Eclipse Public License 1.0 | 5 votes |
protected static IFolder mkdirs ( final IFolder base, final IProgressMonitor monitor, final String... path ) throws CoreException { IFolder folder = base; for ( final String tok : path ) { folder = folder.getFolder ( tok ); if ( !folder.isAccessible () ) { folder.create ( true, true, monitor ); } } return folder; }
Example 5
Source File: JarFileExportOperation.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private IContainer[] getOutputContainers(IJavaProject javaProject) throws CoreException { Set<IPath> outputPaths= new HashSet<IPath>(); boolean includeDefaultOutputPath= false; IPackageFragmentRoot[] roots= javaProject.getPackageFragmentRoots(); for (int i= 0; i < roots.length; i++) { if (roots[i] != null) { IClasspathEntry cpEntry= roots[i].getRawClasspathEntry(); if (cpEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) { IPath location= cpEntry.getOutputLocation(); if (location != null) outputPaths.add(location); else includeDefaultOutputPath= true; } } } if (includeDefaultOutputPath) { // Use default output location outputPaths.add(javaProject.getOutputLocation()); } // Convert paths to containers Set<IContainer> outputContainers= new HashSet<IContainer>(outputPaths.size()); Iterator<IPath> iter= outputPaths.iterator(); while (iter.hasNext()) { IPath path= iter.next(); if (javaProject.getProject().getFullPath().equals(path)) outputContainers.add(javaProject.getProject()); else { IFolder outputFolder= createFolderHandle(path); if (outputFolder == null || !outputFolder.isAccessible()) { String msg= JarPackagerMessages.JarFileExportOperation_outputContainerNotAccessible; addToStatus(new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, msg, null))); } else outputContainers.add(outputFolder); } } return outputContainers.toArray(new IContainer[outputContainers.size()]); }