Example usage for java.lang Boolean Boolean

List of usage examples for java.lang Boolean Boolean

Introduction

In this page you can find the example usage for java.lang Boolean Boolean.

Prototype

@Deprecated(since = "9")
public Boolean(String s) 

Source Link

Document

Allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true" .

Usage

From source file:org.fcrepo.client.impl.FedoraResourceImplTest.java

@Before
public void setUp() throws IOException {
    initMocks(this);
    when(mockRepository.getRepositoryUrl()).thenReturn(repositoryURL);
    resource = new FedoraResourceImpl(mockRepository, mockHelper, path);
    assertTrue(resource != null);/*  w ww  .  j  a va2s  .com*/

    final Graph graph = createDefaultGraph();
    graph.add(create(createURI(repositoryURL + "/test"), RdfLexicon.CREATED_DATE.asNode(),
            ResourceFactory.createPlainLiteral(testDateValue).asNode()));
    graph.add(create(createURI(repositoryURL + "/test"), RdfLexicon.LAST_MODIFIED_DATE.asNode(),
            ResourceFactory.createPlainLiteral(testDateValue).asNode()));
    graph.add(create(createURI(repositoryURL + "/test"), RdfLexicon.HAS_MIXIN_TYPE.asNode(),
            createURI(testMixinType)));
    graph.add(create(createURI(repositoryURL + "/test"), RdfLexicon.WRITABLE.asNode(),
            ResourceFactory.createTypedLiteral(new Boolean(isWritable)).asNode()));
    resource.setGraph(graph);
}

From source file:com.vmware.events.PollingVMEvents.java

/**
 * Creates the event filter Spec./*from   w w w .ja  v a 2s .  co m*/
 *
 * @return the PropertyFilterSpec
 */
PropertyFilterSpec createEventFilterSpec() {
    PropertySpec propSpec = new PropertySpec();
    propSpec.setAll(new Boolean(false));

    propSpec.getPathSet().add("latestPage");
    propSpec.setType(eventHistoryCollectorRef.getType());

    ObjectSpec objSpec = new ObjectSpec();
    objSpec.setObj(eventHistoryCollectorRef);
    objSpec.setSkip(new Boolean(false));

    PropertyFilterSpec spec = new PropertyFilterSpec();
    spec.getPropSet().add(propSpec);
    spec.getObjectSet().add(objSpec);
    return spec;
}

From source file:com.baobao121.baby.common.SimpleUploaderServlet.java

/**
 * Initialize the servlet.<br>/*from   w w  w.  j a  va  2 s .co m*/
 * Retrieve from the servlet configuration the "baseDir" which is the root
 * of the file repository:<br>
 * If not specified the value of "/UserFiles/" will be used.<br>
 * Also it retrieve all allowed and denied extensions to be handled.
 * 
 */
public void init() throws ServletException {

    debug = (new Boolean(getInitParameter("debug"))).booleanValue();

    if (debug)
        System.out.println("\r\n---- SimpleUploaderServlet initialization started ----");

    enabled = (new Boolean(getInitParameter("enabled"))).booleanValue();
    if (baseDir == null)
        baseDir = "/uploadDir/";
    String realBaseDir = getServletContext().getRealPath(baseDir);
    File baseFile = new File(realBaseDir);
    if (!baseFile.exists()) {
        baseFile.mkdir();
    }

    allowedExtensions = new Hashtable(3);
    deniedExtensions = new Hashtable(3);
    allowedExtensions.put("Image", stringToArrayList(getInitParameter("AllowedExtensionsImage")));
    // deniedExtensions.put("Image",stringToArrayList(getInitParameter("DeniedExtensionsImage")));
    if (debug)
        System.out.println("---- SimpleUploaderServlet initialization completed ----\r\n");

}

From source file:com.brsanthu.dataexporter.DataExporterTestBase.java

protected void addDataBeans() {
    List<SampleBean> beans = new ArrayList<SampleBean>();
    beans.add(new SampleBean(new Date(dateReference - 2397984), new Integer(1), "Laptop", new Boolean(false),
            new Integer(1), new Double(799.78)));
    beans.add(new SampleBean(new Date(dateReference - 232042098), new Integer(2), "Mouse", new Boolean(true),
            new Integer(2), new Double(49.30)));
    beans.add(new SampleBean(new Date(dateReference - 234084277), new Integer(3), "Keyboard",
            new Boolean(false), new Integer(5), new Double(75)));

    exporter.addBeanRows(beans);//from   w  w w . j  av a  2s  .  c o m
}

From source file:easycare.cuke.steps.PasswordSteps.java

@Given("^the following reset password token exists for user \"?([^\"]*)\"?$")
public void theFollowingTokenResetPasswordExist(String username, DataTable userValues) {
    UserBuilder userBuilder = new UserBuilder().withRandomValues()
            .withPassword(UserGeneratorHelper.DEFAULT_PASSWORD).withUsername(username);
    User user = userBuilderService.findOrBuildUser(userBuilder);

    for (Map<String, String> tokenMap : userValues.asMaps()) {
        String token = StepUtils.getMapAttribute(tokenMap, "token");
        LocalDateTime date = StepUtils.getMapAttributeAsLocalDateTime(tokenMap, "date");
        boolean expired = new Boolean(StepUtils.getMapAttribute(tokenMap, "expired"));
        UserPasswordToken ufp = new UserPasswordToken();
        ufp.setUser(user);//from  w  w  w .j  a va 2 s .  c o  m
        ufp.setUuid(token);
        ufp.setDate(date);
        ufp.setUsed(expired);
        this.userSetPasswordService.save(ufp);
    }
}

From source file:com.alfaariss.oa.authorization.method.web.ip.IPAuthorizationMethod.java

/**
 * DD A minimum of one configured 'range' section is needed
 * @see AbstractWebAuthorizationMethod#start(IConfigurationManager, 
 *  org.w3c.dom.Element, java.util.Map)/*ww w .  j  a  v  a  2  s  . c o m*/
 */
public void start(IConfigurationManager oConfigurationManager, Element eConfig,
        Map<String, IAuthorizationAction> mapActions) throws OAException {
    super.start(oConfigurationManager, eConfig, mapActions);
    _logger.debug("Authorization method '" + getID() + "' starting...");

    _lRanges = new LinkedList<IPAuthRange>();

    Element eRanges = _configManager.getSection(eConfig, "ranges");
    if (eRanges == null) {
        _logger.error("No 'ranges' section found in configuration for method: " + getID());
        throw new OAException(SystemErrors.ERROR_CONFIG_READ);
    }

    String sValue = _configManager.getParam(eRanges, "match");
    if ("true".equalsIgnoreCase(sValue) || "false".equalsIgnoreCase(sValue)) {
        _bMatch = new Boolean(sValue);

        StringBuffer sbInfo = new StringBuffer("Default value for IP authorization set to ");
        sbInfo.append(_bMatch);
        sbInfo.append(" in authorization method: ");
        sbInfo.append(getID());

        _logger.info(sbInfo.toString());
    } else {
        _logger.error("Misconfigured property 'match' for IP authorization method " + getID());
        throw new OAException(SystemErrors.ERROR_CONFIG_READ);
    }

    Element eOneRange = _configManager.getSection(eRanges, "range");
    while (eOneRange != null) {
        String sStart = _configManager.getParam(eOneRange, "start");
        if (sStart == null) {
            _logger.error("Misconfigured property 'start' for IP authorization method " + getID());
            throw new OAException(SystemErrors.ERROR_CONFIG_READ);
        }

        String sEnd = _configManager.getParam(eOneRange, "end");
        if (sEnd == null) {
            _logger.error("Misconfigured property 'end' for IP authorization method " + getID());
            throw new OAException(SystemErrors.ERROR_CONFIG_READ);
        }

        try {
            IPAuthRange oRange = new IPAuthRange(sStart, sEnd);
            _lRanges.add(oRange);
        } catch (OAException aee) {
            _logger.error("Misconfigured IP value for IP authorization method " + getID());
            throw aee;
        }

        eOneRange = _configManager.getNextSection(eOneRange);
    }

    if (_lRanges.isEmpty()) {
        _logger.error("Not even one 'range' section found in 'ranges' section in configuration for method: "
                + getID());
        throw new OAException(SystemErrors.ERROR_CONFIG_READ);
    }

    _logger.info("IP Authorization method loaded properly: " + getID());
}

From source file:org.toobsframework.tags.FormatHelper.java

/**
 * Public Tag - Message - insert a resource bundle message in the result stream
 * <p>//from  w  w  w  .  j a  v a 2  s .c om
 * <pre><code>
 *   &lt;fmt:message key="<i>key</i>"&gt;
 *   &lt;/fmt:message>
 * </code></pre>
 * 
 * implicit DTD for message
 * 
 * <pre><code>
 * &lt;!ELEMENT fmt:message (fmt:param*)&gt
 * &lt;!ATTLIST fmt:message
 * key CDATA #REQUIRED
 * </code></pre>
 * 
 * Where
 * <p>
 * <ul>
 * <li>key - is the resource bundle message key
 * </ul>
 */
@SuppressWarnings("unchecked")
public void message(XSLProcessorContext processorContext, ElemExtensionCall extensionElement)
        throws TransformerException {

    // Initialize
    TransformerImpl transformer = processorContext.getTransformer();
    ComponentTransformerHelper transformerHelper = getTransformerHelper(processorContext);

    // Get attributes
    String messageKey = getRequiredStringProperty("key",
            "the property key needs to be provided for the message tag", processorContext, extensionElement);

    // Obtain parameters
    List<String> parameterList = new ArrayList<String>();
    Object oldParameterList = transformer.getParameter(FORMAT_HELPER_PARAMETERS);
    if (extensionElement.hasChildNodes()) {
        transformer.setParameter(FORMAT_HELPER_PARAMETERS, parameterList);
        transformer.executeChildTemplates(extensionElement, true);
        transformer.setParameter(FORMAT_HELPER_PARAMETERS,
                oldParameterList == null ? new Boolean(false) : oldParameterList);
    }

    // Compute Results
    IRequest request = getComponentRequest(processorContext);
    if (request == null) {
        throw new TransformerException("Internal error: Invalid request passed to the layout through the "
                + IXMLTransformer.TRANSFORMER_HELPER);
    }
    try {
        LocaleResolver localeResolver = (LocaleResolver) request.getHttpRequest()
                .getAttribute(DispatcherServlet.LOCALE_RESOLVER_ATTRIBUTE);
        Locale locale = localeResolver.resolveLocale(request.getHttpRequest());

        String message = transformerHelper.getApplicationContext().getMessage(messageKey,
                parameterList.toArray(), locale);

        if (oldParameterList == null) {
            serialize(processorContext, extensionElement, message, false);
        } else if (oldParameterList instanceof List) {
            ((List<String>) oldParameterList).add(message);
        }
    } catch (Exception ex) {
        throw new TransformerException("Error getting message for key=" + messageKey + ": " + ex.getMessage(),
                ex);
    }
}

From source file:com.duroty.application.bookmark.utils.BookmarkDefaultAction.java

/**
 * DOCUMENT ME!/* www  . j  av a  2s. c  o m*/
 *
 * @param request DOCUMENT ME!
 *
 * @return DOCUMENT ME!
 *
 * @throws NamingException DOCUMENT ME!
 * @throws RemoteException DOCUMENT ME!
 * @throws CreateException DOCUMENT ME!
 */
protected Bookmark getBookmarkInstance(HttpServletRequest request)
        throws NamingException, RemoteException, CreateException {
    BookmarkHome home = null;

    Boolean localServer = new Boolean(Configuration.properties.getProperty(Configuration.LOCAL_WEB_SERVER));

    if (localServer.booleanValue()) {
        home = BookmarkUtil.getHome();
    } else {
        Hashtable environment = getContextProperties(request);
        home = BookmarkUtil.getHome(environment);
    }

    return home.create();
}

From source file:es.pode.modificador.presentacion.pendientes.ModificacionesPendientesControllerImpl.java

/**
  * @see es.pode.modificador.presentacion.pendientes.ModificacionesPendientesController#recuperarModificaciones(org.apache.struts.action.ActionMapping, es.pode.modificador.presentacion.pendientes.RecuperarModificacionesForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
  *//*from   w ww  .jav  a 2  s  .  com*/
public final void recuperarModificaciones(ActionMapping mapping,
        es.pode.modificador.presentacion.pendientes.RecuperarModificacionesForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
    request.getSession().setAttribute("offline", new Boolean(DecisorOffline.esOffline()));
    // Meto en sesion la URL de vuelta en la version offline
    if (request.getParameter("urlCerrar") != null)
        request.getSession().setAttribute("urlCerrar", request.getParameter("urlCerrar"));
    ModificacionVO[] modificacionesPendientes = this.getSrvHerramientaModificacion()
            .obtenerModificacionesConfiguradas();
    List modificacionesPendientesList = new ArrayList();

    for (int i = 0; i < modificacionesPendientes.length; i++) {
        modificacionesPendientesList.add(i, modificacionesPendientes[i]);
    }

    form.setOffline(DecisorOffline.esOffline());
    form.setModificaciones(modificacionesPendientesList);
    logger.debug("Se ha recuperado las modificaciones pendientes+ " + form.getModificaciones());
    form.setIdiomaBuscadorBackingList(
            IdiomasBuscadorSingleton.getInstance().obtenerIdiomas(LdapUserDetailsUtils.getIdioma()),
            "idLocalizacion", "nombre");

}

From source file:com.netspective.sparx.template.freemarker.TemplateExistsMethod.java

public Object exec(List args) throws TemplateModelException {
    if (args.size() != 1) {
        throw new TemplateModelException("Wrong arguments: expect name of template to check existence.");
    }//from w  w  w.  ja  v  a 2  s .  com

    Environment env = Environment.getCurrentEnvironment();
    boolean found = false;
    try {
        found = env.getConfiguration().getTemplate((String) args.get(0)) != null;
    } catch (FileNotFoundException e) {
        found = false;
    } catch (IOException e) {
        log.error("Unable to check template existence.", e);
        found = false;
    }

    return BeansWrapper.getDefaultInstance().wrap(new Boolean(found));
}