private String directoryLevelInRequirementsHierarchy(File narrativeFile, int requirementsLevel) { String normalizedNarrativePath = normalized(narrativeFile.getAbsolutePath()); String normalizedRootPath = normalized(rootDirectory); int rootDirectoryStart = normalizedNarrativePath.lastIndexOf(normalizedRootPath); int rootDirectoryEnd = (rootDirectoryStart >= 0) ? rootDirectoryStart + normalizedRootPath.length() : 0; String relativeNarrativePath = normalizedNarrativePath.substring(rootDirectoryEnd); int directoryCount = fileSystemPathElements(relativeNarrativePath).size() - 1; int level = requirementsLevel + directoryCount - 1; return getRequirementTypeForLevel(level); }
private String directoryLevelInRequirementsHierarchy(File narrativeFile, int requirementsLevel) { String normalizedNarrativePath = normalized(narrativeFile.getAbsolutePath()); String normalizedRootPath = normalized(rootDirectory); int rootDirectoryStart = findRootDirectoryStart(normalizedNarrativePath, normalizedRootPath); int rootDirectoryEnd = findRootDirectoryEnd(rootDirectoryStart, normalizedNarrativePath, normalizedRootPath); String relativeNarrativePath = normalizedNarrativePath.substring(rootDirectoryEnd); int directoryCount = RequirementsPath.fileSystemPathElements(relativeNarrativePath).size() - 1; int level = requirementsLevel + directoryCount - 1; return getRequirementTypeForLevel(level); }
private String directoryLevelInRequirementsHierarchy(File narrativeFile, int requirementsLevel) { String normalizedNarrativePath = normalized(narrativeFile.getAbsolutePath()); String normalizedRootPath = normalized(rootDirectory); int rootDirectoryStart = findRootDirectoryStart(normalizedNarrativePath, normalizedRootPath); int rootDirectoryEnd = findRootDirectoryEnd(rootDirectoryStart, normalizedNarrativePath, normalizedRootPath); String relativeNarrativePath = normalizedNarrativePath.substring(rootDirectoryEnd); int directoryCount = fileSystemPathElements(relativeNarrativePath).size() - 1; int level = requirementsLevel + directoryCount - 1; return getRequirementTypeForLevel(level); }