@Override public IDirectory getParent() { return _delegate.getParent(); }
private String getEntryName() { if (_entry != null) { return _entry.getName(); } else { String result = _name; IDirectory parent = _parent; while (!(parent instanceof JarFileDirectoryImpl)) { result = parent.getName() + "/" + result; parent = parent.getParent(); } return result; } }
private static IDirectory findParentDirectory(IDirectory root, List<String> relativePath) { IDirectory parent = root; for (String pathComponent : relativePath) { if (pathComponent.equals(".")) { // Do nothing } else if (pathComponent.equals("..")) { parent = parent.getParent(); } else { parent = parent.dir(pathComponent); } } return parent; }
private String getEntryName() { if (_entry != null) { return _entry.getName(); } else { String result = _name; IDirectory parent = _parent; while (!(parent instanceof JarFileDirectoryImpl)) { result = parent.getName() + "/" + result; parent = parent.getParent(); } return result; } }
private static IDirectory findParentDirectory(IDirectory root, List<String> relativePath) { IDirectory parent = root; for (String pathComponent : relativePath) { if (pathComponent.equals(".")) { // Do nothing } else if (pathComponent.equals("..")) { parent = parent.getParent(); } else { parent = parent.dir(pathComponent); } } return parent; }
return sourceFolders.get( 0 ).getParent();
private static IDirectory executeOnSourceDirectory(IDirectory dir, SourceDirectoryBlock block){ IFile moduleFile = dir.file("pom.xml"); IDirectory foundModule = null; if (moduleFile != null && moduleFile.exists()) { // This entry is itself a module, so return that block.doIt(dir, moduleFile); } else if (!dir.getName().endsWith(".jar")) { IDirectory parentDir = dir.getParent(); if (parentDir != null) { IFile parentModuleFile = parentDir.file("pom.xml"); if (parentModuleFile.exists() && moduleContainsSourceDir(parentModuleFile, dir)) { // Module.xml file in the parent directory, so that directory is a module block.doIt(parentDir, parentModuleFile); } else { // No module.xml file in the parent directory either, the original directory is the module block.doIt(dir, null); } } else { // No parent directory at all, so just the original directory is the module block.doIt(dir, null); } } else { // It's a jar file with no module.xml inside, so the jar is the module block.doIt(dir, null); } return foundModule; }
private static IDirectory executeOnSourceDirectory(IDirectory dir, SourceDirectoryBlock block){ IFile moduleFile = dir.file("pom.xml"); IDirectory foundModule = null; if (moduleFile != null && moduleFile.exists()) { // This entry is itself a module, so return that block.doIt(dir, moduleFile); } else if (!dir.getName().endsWith(".jar")) { IDirectory parentDir = dir.getParent(); if (parentDir != null) { IFile parentModuleFile = parentDir.file("pom.xml"); if (parentModuleFile.exists() && moduleContainsSourceDir(parentModuleFile, dir)) { // Module.xml file in the parent directory, so that directory is a module block.doIt(parentDir, parentModuleFile); } else { // No module.xml file in the parent directory either, the original directory is the module block.doIt(dir, null); } } else { // No parent directory at all, so just the original directory is the module block.doIt(dir, null); } } else { // It's a jar file with no module.xml inside, so the jar is the module block.doIt(dir, null); } return foundModule; }