List of usage examples for java.lang Boolean Boolean
@Deprecated(since = "9") public Boolean(String s)
From source file:com.rapidsist.portal.cliente.editor.SimpleUploaderServlet.java
/** * Initialize the servlet.<br>// w ww .j a va2 s . c om * 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 { System.out.println("PASO POR EL METODO init DEL SERVLET SimpleUploaderServlet"); baseDir = getInitParameter("baseDir"); enabled = (new Boolean(getInitParameter("enabled"))).booleanValue(); if (baseDir == null) baseDir = "/UserFiles/"; 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("File", stringToArrayList(getInitParameter("AllowedExtensionsFile"))); deniedExtensions.put("File", stringToArrayList(getInitParameter("DeniedExtensionsFile"))); allowedExtensions.put("Image", stringToArrayList(getInitParameter("AllowedExtensionsImage"))); deniedExtensions.put("Image", stringToArrayList(getInitParameter("DeniedExtensionsImage"))); allowedExtensions.put("Flash", stringToArrayList(getInitParameter("AllowedExtensionsFlash"))); deniedExtensions.put("Flash", stringToArrayList(getInitParameter("DeniedExtensionsFlash"))); }
From source file:com.redhat.lightblue.metadata.types.StringTypeTest.java
@Test public void testToJson() { JsonNodeFactory jsonNodeFactory = new JsonNodeFactory(true); JsonNode jsonNode = stringType.toJson(jsonNodeFactory, "json"); assertTrue(new Boolean(jsonNode.asText().equals("json"))); }
From source file:agilejson.JSON.java
/** * This method takes in a primitive that has been converted to an object * and creates a copy of it so that .equals results in different objects. * @param v//from ww w . jav a 2s. c o m * @throws java.lang.Exception */ private static Object getObjectForPrimitive(Object v) throws Exception { Class c = v.getClass(); if (c == Byte.class) { return new String(new byte[] { ((Byte) v).byteValue() }); } else if (c == Boolean.class) { return new Boolean((Boolean) v); } else if (c == Character.class) { return new Character((Character) v); } else if (c == Short.class) { return new Short((Short) v); } else if (c == Integer.class) { return new Integer((Integer) v); } else if (c == Long.class) { return new Long((Long) v); } else if (c == Float.class) { return new Float((Float) v); } else if (c == Double.class) { return new Double((Double) v); } else { throw new Exception("Unknown Primitive"); } }
From source file:baggage.hypertoolkit.views.JSONResponse.java
public JSONResponse(boolean b) { this(new Boolean(b), HttpServletResponse.SC_OK); }
From source file:com.redhat.lightblue.metadata.types.BooleanTypeTest.java
@Test public void testToJson() { JsonNodeFactory jsonNodeFactory = new JsonNodeFactory(true); JsonNode jsonNode = booleanType.toJson(jsonNodeFactory, Boolean.TRUE); assertTrue(new Boolean(jsonNode.asBoolean()).equals(Boolean.TRUE)); }
From source file:com.sun.socialsite.config.RuntimeConfig.java
/** * Retrieve a property as a boolean ... defaults to false if there is an error **///ww w .j a v a 2 s. co m public static boolean getBooleanProperty(String name) { // get the value first, then convert String value = RuntimeConfig.getProperty(name); if (value == null) return false; return (new Boolean(value)).booleanValue(); }
From source file:com.sshtools.common.ui.NewWindowAction.java
/** * Creates a new NewWindowAction object. * * @param application/*from www .ja va2s . c om*/ */ public NewWindowAction(SshToolsApplication application) { this.application = application; putValue(Action.NAME, "New Window"); putValue(Action.SMALL_ICON, getIcon("/com/sshtools/common/ui/newwindow.png")); putValue(LARGE_ICON, getIcon("/com/sshtools/common/ui/largenewwindow.png")); putValue(Action.SHORT_DESCRIPTION, "Create new window"); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.ALT_MASK)); putValue(Action.LONG_DESCRIPTION, "Create a new SSHTerm window"); putValue(Action.MNEMONIC_KEY, new Integer('w')); putValue(Action.ACTION_COMMAND_KEY, "new-window"); putValue(StandardAction.ON_MENUBAR, new Boolean(true)); putValue(StandardAction.MENU_NAME, "File"); putValue(StandardAction.MENU_ITEM_GROUP, new Integer(0)); putValue(StandardAction.MENU_ITEM_WEIGHT, new Integer(90)); putValue(StandardAction.ON_TOOLBAR, new Boolean(true)); putValue(StandardAction.TOOLBAR_GROUP, new Integer(0)); putValue(StandardAction.TOOLBAR_WEIGHT, new Integer(90)); }
From source file:com.useeasy.auction.util.upload.SimpleUploaderServlet.java
/** * Initialize the servlet.<br>//from ww w. j a va 2 s . c om * 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 ----"); baseDir = getInitParameter("baseDir"); enabled = (new Boolean(getInitParameter("enabled"))).booleanValue(); if (baseDir == null) baseDir = "/UserFiles/"; 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("File", stringToArrayList(getInitParameter("AllowedExtensionsFile"))); deniedExtensions.put("File", stringToArrayList(getInitParameter("DeniedExtensionsFile"))); allowedExtensions.put("Image", stringToArrayList(getInitParameter("AllowedExtensionsImage"))); deniedExtensions.put("Image", stringToArrayList(getInitParameter("DeniedExtensionsImage"))); allowedExtensions.put("Flash", stringToArrayList(getInitParameter("AllowedExtensionsFlash"))); deniedExtensions.put("Flash", stringToArrayList(getInitParameter("DeniedExtensionsFlash"))); if (debug) System.out.println("---- SimpleUploaderServlet initialization completed ----\r\n"); }
From source file:cn.itcast.fredck.FCKeditor.connector.ConnectorServlet.java
/** * Initialize the servlet.<br>//from w w w. j a v a 2s .c o 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. * */ @Override public void init() throws ServletException { baseDir = getInitParameter("baseDir"); debug = (new Boolean(getInitParameter("debug"))).booleanValue(); if (baseDir == null) baseDir = "/UserFiles/"; String realBaseDir = getServletContext().getRealPath(baseDir); File baseFile = new File(realBaseDir); if (!baseFile.exists()) { baseFile.mkdir(); } }
From source file:it.jnrpe.plugins.factory.COption.java
public void setArgsOptional(String sArgsOptional) { m_bArgsOptional = new Boolean(sArgsOptional.equals("true")); }