private String getImportedPrependString(String text) { String accessPath = ServerConfigurationService.getAccessPath(); String referenceRoot = AssessmentService.getContentHostingService().REFERENCE_ROOT; String importedPrependString = accessPath + referenceRoot; String[] splittedString = text.split("src=\""); for (int i = 0; i < splittedString.length; i ++) { String[] splittedRefString = splittedString[i].split("href=\""); for (int j = 0; j < splittedRefString.length; j++) { if (splittedRefString[j].indexOf(importedPrependString) > -1) { int length = importedPrependString.length(); return splittedRefString[j].substring(0, splittedRefString[j].indexOf(importedPrependString) + length); } } } return null; }
private String getImportedPrependString(String text) { String accessPath = ServerConfigurationService.getAccessPath(); String referenceRoot = AssessmentService.getContentHostingService().REFERENCE_ROOT; String importedPrependString = accessPath + referenceRoot; String[] splittedString = text.split("src=\""); for (int i = 0; i < splittedString.length; i ++) { String[] splittedRefString = splittedString[i].split("href=\""); for (int j = 0; j < splittedRefString.length; j++) { if (splittedRefString[j].indexOf(importedPrependString) > -1) { int length = importedPrependString.length(); return splittedRefString[j].substring(0, splittedRefString[j].indexOf(importedPrependString) + length); } } } return null; }