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.mingo.parser.xml.dom.DomUtil.java
/** * Gets attribute by name.//from w ww .ja v a 2 s. c o m * * @param node {@link Node} * @param attributeName attribute name * @return attribute value with type 'string' */ public static String getAttributeString(Node node, String attributeName) { Validate.notNull(node, "getAttributeString::node cannot be null"); String value = StringUtils.EMPTY; if (node.hasAttributes()) { value = getAttributes(node).get(attributeName); } return value; }
From source file:com.vrem.wifianalyzer.wifi.graph.channel.ChannelAxisLabel.java
private String findChannel(int value) { WiFiChannels wiFiChannels = wiFiBand.getWiFiChannels(); WiFiChannel wiFiChannel = wiFiChannels.getWiFiChannelByFrequency(value, wiFiChannelPair); if (wiFiChannel == WiFiChannel.UNKNOWN) { return StringUtils.EMPTY; }/*from w w w .java 2 s .c o m*/ int channel = wiFiChannel.getChannel(); if (!wiFiChannels.isChannelAvailable(locale, channel)) { return StringUtils.EMPTY; } return "" + channel; }
From source file:controller.UpdateEC.java
/** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods./*from w ww.j av a 2 s .co 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"); ExtenuatingCircumstance ec = new ExtenuatingCircumstance(); if (ServletFileUpload.isMultipartContent(request)) { try { String fname = StringUtils.EMPTY; String title = StringUtils.EMPTY; String desciption = StringUtils.EMPTY; String status = StringUtils.EMPTY; int id = 0; List<FileItem> multiparts = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request); ArrayList<FileItem> files = new ArrayList<>(); for (FileItem item : multiparts) { if (item.isFormField()) { if (item.getFieldName().equals("id")) { id = Integer.parseInt(item.getString()); System.out.println("id: " + id); } if (item.getFieldName().equals("title")) { title = item.getString(); } if (item.getFieldName().equals("description")) { desciption = item.getString(); } if (item.getFieldName().equals("status")) { status = item.getString(); System.out.println("status: " + status); } } else { if (StringUtils.isNotEmpty(item.getName())) { files.add(item); } } } HttpSession session = request.getSession(false); Account studentAccount = (Account) session.getAttribute("account"); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss"); LocalDateTime now = LocalDateTime.now(); // insert EC ec.setId(id); ec.setTitle(title); ec.setDescription(desciption); ec.setProcess_status(status); //ec.setSubmitted_date(now.toString()); ec.setAccount(studentAccount.getId()); new ExtenuatingCircumstanceDAO().updateEC(ec, "student"); //insert additional evident evidence if (files.size() > 0) { insertedEvidence(files, now, ec, studentAccount); } request.setAttribute("resultMsg", "updated"); request.getRequestDispatcher("AddNewECResult.jsp").forward(request, response); } catch (Exception e) { e.printStackTrace(); } } else { request.setAttribute("message", "Sorry this Servlet only handles file upload request"); } }
From source file:cop.raml.utils.Utils.java
private static String removeTrailingSlashes(String str) { if (str == null) return null; if (StringUtils.isBlank(str)) return StringUtils.EMPTY; return TRAILING_SLASH.matcher(str).replaceAll(""); }
From source file:com.quatico.base.aem.test.api.setup.Tags.java
@Override public String renderTag(TagSupport tag, PageContext pageContext) throws Exception { return renderTag(tag, pageContext, StringUtils.EMPTY); }
From source file:com.aqnote.app.wifianalyzer.wifi.AccessPointsDetailTest.java
@Test public void testSetViewWithIpAddressAndLinkSpeedGone() throws Exception { // setup/*from w w w .ja v a 2s .c o m*/ WiFiAdditional wiFiAdditional = new WiFiAdditional(StringUtils.EMPTY, "IPAddress", 22); WiFiDetail wiFiDetail = withWiFiDetail("SSID", wiFiAdditional); // execute fixture.setView(mainActivity.getResources(), view, wiFiDetail, false); // validate assertEquals(View.GONE, view.findViewById(R.id.ipAddress).getVisibility()); assertEquals(View.GONE, view.findViewById(R.id.linkSpeed).getVisibility()); }
From source file:com.neatresults.mgnltweaks.ui.field.TemplateIdConverter.java
@Override public String convertToPresentation(String path, Class<? extends String> targetType, Locale locale) throws ConversionException { String res = StringUtils.EMPTY; if (StringUtils.isBlank(path)) { return res; }/*from w w w. j a va 2 s . c o m*/ return NeatUtil.templateIdToPath(path); }
From source file:com.qwazr.store.store.StoreService.java
@GET @Path("/") public Response get(@Context UriInfo uriInfo) throws IOException { return get(uriInfo, StringUtils.EMPTY); }
From source file:de.blizzy.documentr.web.util.FacadeHostRequestWrapperTest.java
@Test @SuppressWarnings("nls") public void buildFacadeUrl() { assertEquals("https://documentr.org/page", FacadeHostRequestWrapper .buildFacadeUrl("http://localhost:38080/documentr/page", "/documentr", "https://documentr.org")); assertEquals("https://documentr.org:1234/page", FacadeHostRequestWrapper.buildFacadeUrl( "http://localhost:38080/documentr/page", "/documentr", "https://documentr.org:1234")); assertEquals("https://documentr.org:1234/docs/page", FacadeHostRequestWrapper.buildFacadeUrl( "http://localhost:38080/documentr/page", "/documentr", "https://documentr.org:1234/docs")); assertEquals("https://documentr.org/page", FacadeHostRequestWrapper .buildFacadeUrl("http://localhost:38080/page", StringUtils.EMPTY, "https://documentr.org")); assertEquals("https://documentr.org:1234/page", FacadeHostRequestWrapper .buildFacadeUrl("http://localhost:38080/page", StringUtils.EMPTY, "https://documentr.org:1234")); assertEquals("https://documentr.org:1234/docs/page", FacadeHostRequestWrapper.buildFacadeUrl( "http://localhost:38080/page", StringUtils.EMPTY, "https://documentr.org:1234/docs")); assertEquals("https://documentr.org:1234/docs", FacadeHostRequestWrapper .buildFacadeUrl("http://localhost:38080", StringUtils.EMPTY, "https://documentr.org:1234/docs")); }
From source file:ch.sentric.QueryFactoryTest.java
@Test public void buildShouldReturnNothingWhenPhpsessidIsTheOnlyParameter() { final Query query = new QueryFactory().build("phpsessid=9ADD207E33B1E66CE6121BC73AADB986"); assertEquals(StringUtils.EMPTY, query.getAsSortedString()); }