List of usage examples for org.apache.commons.lang3 StringUtils EMPTY
String EMPTY
To view the source code for org.apache.commons.lang3 StringUtils EMPTY.
Click Source Link
From source file:com.apus.hades.admin.task.AdSchedulingUpDownTask.java
public void run() { success = 0;/* w w w . j ava2 s .c om*/ Config config = configManager.find(ConfigCache.REAL_AD_UP_DOWN.getKey()); if (null == config) { return; } JSONArray array = JSONArray.fromObject(config.getValue()); if (null == array || array.isEmpty()) { return; } int size = array.size(); for (int i = 0; i < size; i++) { String s = StringUtils.EMPTY; try { s = array.getString(i); JSONObject jsonObject = array.getJSONObject(i); this.processConfig(jsonObject); } catch (Exception e) { logger.error("[]!:" + s, e); } } if (success > 0) { config.setValue(array.toString().replaceAll("\"", StringUtils.EMPTY)); configManager.update(config); } logger.info("[],?:{}?", success); }
From source file:cop.raml.utils.Utils.java
private static String removeLeadingSlashes(String str) { if (str == null) return null; if (StringUtils.isBlank(str)) return StringUtils.EMPTY; return LEADING_SLASH.matcher(str).replaceAll(""); }
From source file:com.vrem.wifianalyzer.wifi.channelgraph.ChannelAxisLabelTest.java
@Test public void testYAxis() throws Exception { assertEquals(StringUtils.EMPTY, fixture.formatLabel(GraphViewBuilder.MIN_Y, false)); assertEquals("-99", fixture.formatLabel(GraphViewBuilder.MIN_Y + 1, false)); assertEquals("0", fixture.formatLabel(GraphViewBuilder.MAX_Y, false)); assertEquals(StringUtils.EMPTY, fixture.formatLabel(GraphViewBuilder.MAX_Y + 1, false)); }
From source file:controller.ServerValidation.java
/** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods.//from ww w. j a v a 2 s . c o m * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); String email = request.getParameter("email"); String firstname = request.getParameter("firstname"); String middlename = request.getParameter("middlename"); String lastname = request.getParameter("lastname"); System.out.println(email + "-" + firstname + "-" + middlename + "-" + lastname); Profile f = new Profile(); f.setFirstname(firstname); f.setMiddlename(middlename); f.setLastname(lastname); String resultMsg = StringUtils.EMPTY; try { boolean isProfileExisted = new ProfileDAO().checkExistingProfileByName(f); String username = new AccountDAO().getUsernameByEmail(email); if (isProfileExisted) { resultMsg = "profile"; response.getWriter().print(resultMsg); return; } if (StringUtils.isNotEmpty(username)) { resultMsg = "email"; response.getWriter().print(resultMsg); } } catch (SQLException ex) { Logger.getLogger(ServerValidation.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:de.micromata.tpsb.doc.parser.JavaDocInfo.java
public String getParamDoc(String paramName) { if (tags.get("@param") == null) { return StringUtils.EMPTY; }/*from w w w.j a v a2 s. c om*/ List<Pair<String, String>> params = tags.get("@param"); for (Pair<String, String> param : params) { if (StringUtils.equals(paramName, param.getFirst()) == true) { return param.getSecond(); } } return StringUtils.EMPTY; }
From source file:com.aqnote.app.wifianalyzer.vendor.model.RemoteResult.java
private String getValue(@NonNull JSONObject jsonObject, @NonNull String key) { try {//from w w w . j a v a 2s.c o m String result = jsonObject.getString(key); return result == null ? StringUtils.EMPTY : result; } catch (JSONException e) { return StringUtils.EMPTY; } }
From source file:ch.cyberduck.ui.cocoa.DownloadController.java
public DownloadController(final WindowController parent) { this(parent, StringUtils.EMPTY); }
From source file:de.hasait.genesis.base.freemarker.HeaderFilterTemplateLoader.java
@Override public Reader getReader(final Object templateSource, final String encoding) throws IOException { final Reader reader = _delegate.getReader(templateSource, encoding); try {/*from w w w .j a va 2 s . co m*/ String templateContent = IOUtils.toString(reader); templateContent = FILTER_PATTERN.matcher(templateContent).replaceFirst(StringUtils.EMPTY); return new StringReader(templateContent); } finally { _delegate.closeTemplateSource(templateSource); } }
From source file:com.ltln.modules.ni.omc.system.core.ftp.OmcFtplet.java
@Override public FtpletResult onConnect(final FtpSession session) throws FtpException, IOException { Logger.info(String.format("User %s connected to FtpServer", session.getClientAddress().toString())); if (this.listener != null) { SelfBeanFactoryAware.getTaskThreadPool().submit(new Runnable() { @Override//from w ww .j av a 2s .co m public void run() { String user = session.getUser() == null ? StringUtils.EMPTY : session.getUser().getName(); listener.ConnectionActive( new ConnectionModel(session.getClientAddress().toString(), EConnectionType.FTP, user)); } }); } return super.onConnect(session); }
From source file:de.blizzy.documentr.markdown.macro.impl.TabData.java
String renderContents(String id, boolean active) { return "<div id=\"" + id + "\" class=\"tab-pane" + (active ? " active" : StringUtils.EMPTY) + "\">" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ contents + "</div>"; //$NON-NLS-1$ }