protected InputStream getWSSE(ServletContext context) { if (context == null) { throw logger.nullValueError("Servlet Context"); } InputStream is = context.getResourceAsStream("/WEB-INF/jboss-wsse.xml"); return is; }
private void checkProperty(final String propertyName, final String propertyValue) { if (propertyValue == null || propertyValue.equals("")) throw logger.nullValueError(propertyValue); } }
private void checkProperty(final String propertyName, final String propertyValue) { if (propertyValue == null || propertyValue.equals("")) throw logger.nullValueError(propertyValue); } }
/** * <p>Returns a {@link InputStream} for the jboss-web.xml configuration file.</p> * * @param context * * @return */ private InputStream getJBossWeb(ServletContext context) { if (context == null) { throw logger.nullValueError("Servlet Context"); } return context.getResourceAsStream("/WEB-INF/jboss-web.xml"); }
protected InputStream getWSSE(ServletContext context) { if (context == null) { throw logger.nullValueError("Servlet Context"); } InputStream is = context.getResourceAsStream("/WEB-INF/jboss-wsse.xml"); return is; }
/** * <p>Returns a {@link InputStream} for the jboss-web.xml configuration file.</p> * * @param context * * @return */ private InputStream getJBossWeb(ServletContext context) { if (context == null) { throw logger.nullValueError("Servlet Context"); } return context.getResourceAsStream("/WEB-INF/jboss-web.xml"); }
protected String getSecurityDomain() throws NamingException { // Get the SecurityManagerService from JNDI InitialContext ctx = new InitialContext(); SubjectSecurityManager ssm = (SubjectSecurityManager) ctx.lookup("java:comp/env/security/securityMgr"); if (ssm == null) { throw logger.nullValueError("Unable to get the subject security manager"); } return ssm.getSecurityDomain(); }
private static Source[] sources() throws IOException { List<String> schemas = SchemaManagerUtil.getSchemas(); Source[] sourceArr = new Source[schemas.size()]; int i = 0; for (String schema : schemas) { URL url = SecurityActions.loadResource(JAXPValidationUtil.class, schema); if (url == null) throw logger.nullValueError("schema url:" + schema); sourceArr[i++] = new StreamSource(url.openStream()); } return sourceArr; }
public InputStream getByteStream() { URL url = SecurityActions.loadResource(getClass(), loc); InputStream is; try { is = url.openStream(); } catch (IOException e) { throw new RuntimeException(logger.classNotLoadedError(loc)); } if (is == null) throw logger.nullValueError("inputstream is null for " + loc); return is; }
public InputStream getByteStream() { URL url = SecurityActions.loadResource(getClass(), loc); InputStream is; try { is = url.openStream(); } catch (IOException e) { throw new RuntimeException(logger.classNotLoadedError(loc)); } if (is == null) throw logger.nullValueError("inputstream is null for " + loc); return is; }
private static Source[] sources() throws IOException { List<String> schemas = SchemaManagerUtil.getSchemas(); Source[] sourceArr = new Source[schemas.size()]; int i = 0; for (String schema : schemas) { URL url = SecurityActions.loadResource(JAXPValidationUtil.class, schema); if (url == null) throw logger.nullValueError("schema url:" + schema); sourceArr[i++] = new StreamSource(url.openStream()); } return sourceArr; }
private static Schema getJAXPSchemaInstance(String schemaLocation) throws SAXException { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw logger.nullValueError("Schema URL :" + schemaLocation); SchemaFactory scFact = getSchemaFactory(); Schema schema = scFact.newSchema(schemaURL); return schema; }
public FileBasedTokenRegistry(String fileName) { super(); if (directory == null) throw logger.nullValueError("directory"); // check if the default registry file exists. this.registryFile = create(fileName); try { read(); } catch (IOException e) { throw new RuntimeException(e); } }
private static Schema getJAXPSchemaInstance(String schemaLocation) throws SAXException { URL schemaURL = SecurityActions.loadResource(JAXBUtil.class, schemaLocation); if (schemaURL == null) throw logger.nullValueError("Schema URL :" + schemaLocation); SchemaFactory scFact = getSchemaFactory(); Schema schema = scFact.newSchema(schemaURL); return schema; }
public FileBasedTokenRegistry(String fileName) { super(); if (directory == null) throw logger.nullValueError("directory"); // check if the default registry file exists. this.registryFile = create(fileName); try { read(); } catch (IOException e) { throw new RuntimeException(e); } }
public static Validator validator() throws SAXException, IOException { SystemPropertiesUtil.ensure(); if (validator == null) { Schema schema = getSchema(); if (schema == null) throw logger.nullValueError("schema"); validator = schema.newValidator(); validator.setErrorHandler(new CustomErrorHandler()); } return validator; }
public static Validator validator() throws SAXException, IOException { SystemPropertiesUtil.ensure(); if (validator == null) { Schema schema = getSchema(); if (schema == null) throw logger.nullValueError("schema"); validator = schema.newValidator(); validator.setErrorHandler(new CustomErrorHandler()); } return validator; }
private Object parseSPMetadata() throws ParsingException { InputStream spMetadataStream = SecurityActions.loadStream(getClass(), getSpMetadataLocation()); if (spMetadataStream == null) { throw logger.nullValueError(getSpMetadataLocation()); } return new SAMLParser().parse(spMetadataStream); }
private Object parseSPMetadata() throws ParsingException { InputStream spMetadataStream = SecurityActions.loadStream(getClass(), getSpMetadataLocation()); if (spMetadataStream == null) { throw logger.nullValueError(getSpMetadataLocation()); } return new SAMLParser().parse(spMetadataStream); }
public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response, IDPType idpConfiguration) throws ProcessingException { RequestAbstractType requestType = (RequestAbstractType) request.getSAML2Object(); if (requestType == null) throw logger.nullValueError("AuthnRequest"); String issuer = requestType.getIssuer().getValue(); trustIssuer(idpConfiguration, issuer); }