/** * Processes the given {@code name}, i.e. decodes it and checks * the format of the decoded name. * * @param nameInfo name to process * @return the decoded and valid jcr name or the original name if it is * not encoded or if the resulting decoded name would be illegal. * @throws javax.jcr.RepositoryException */ private NameInfo processName(NameInfo nameInfo) throws RepositoryException { String decodedLocalName = ISO9075.decode(nameInfo.getLocalName()); NameInfo decodedNameInfo = new NameInfo(nameInfo.getDocPrefix(), decodedLocalName); if (!decodedLocalName.equals(nameInfo.getLocalName())) { try { JcrNameParser.checkName(decodedNameInfo.getRepoQualifiedName(), true); } catch (ConstraintViolationException e) { // decoded name would be illegal according to jsr 170, // use encoded name as a fallback log.warn("encountered illegal decoded name '" + decodedLocalName + '\'', e); return nameInfo; } } return decodedNameInfo; }
/** * Processes the given {@code name}, i.e. decodes it and checks * the format of the decoded name. * * @param nameInfo name to process * @return the decoded and valid jcr name or the original name if it is * not encoded or if the resulting decoded name would be illegal. * @throws javax.jcr.RepositoryException */ private NameInfo processName(NameInfo nameInfo) throws RepositoryException { String decodedLocalName = ISO9075.decode(nameInfo.getLocalName()); NameInfo decodedNameInfo = new NameInfo(nameInfo.getDocPrefix(), decodedLocalName); if (!decodedLocalName.equals(nameInfo.getLocalName())) { try { JcrNameParser.checkName(decodedNameInfo.getRepoQualifiedName(), true); } catch (ConstraintViolationException e) { // decoded name would be illegal according to jsr 170, // use encoded name as a fallback log.warn("encountered illegal decoded name '" + decodedLocalName + '\'', e); return nameInfo; } } return decodedNameInfo; }
/** * Processes the given {@code name}, i.e. decodes it and checks * the format of the decoded name. * * @param nameInfo name to process * @return the decoded and valid jcr name or the original name if it is * not encoded or if the resulting decoded name would be illegal. * @throws javax.jcr.RepositoryException */ private NameInfo processName(NameInfo nameInfo) throws RepositoryException { String decodedLocalName = ISO9075.decode(nameInfo.getLocalName()); NameInfo decodedNameInfo = new NameInfo(nameInfo.getDocPrefix(), decodedLocalName); if (!decodedLocalName.equals(nameInfo.getLocalName())) { try { JcrNameParser.checkName(decodedNameInfo.getRepoQualifiedName(), true); } catch (ConstraintViolationException e) { // decoded name would be illegal according to jsr 170, // use encoded name as a fallback log.warn("encountered illegal decoded name '" + decodedLocalName + '\'', e); return nameInfo; } } return decodedNameInfo; }