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:io.github.swagger2markup.spi.MarkupComponent.java
protected String boldText(MarkupDocBuilder markupDocBuilder, String text) { if (StringUtils.isBlank(text)) { return StringUtils.EMPTY; }/*from ww w . ja v a 2 s .c o m*/ return copyMarkupDocBuilder(markupDocBuilder).boldText(text).toString(); }
From source file:com.itjenny.web.ArticleController.java
@RequestMapping(value = "{title}", method = RequestMethod.POST) public ModelAndView save(@PathVariable String title, @RequestParam String content) { ModelAndView mav = new ModelAndView(); ModelMap model = new ModelMap(); Article article = new Article(); article.setTitle(title);//from w ww . j a va2 s . co m article.setContent(content); article.setUserId(StringUtils.EMPTY); article.setPublished(true); articleService.save(article); mav.setViewName(View.ARTICLE); mav.addAllObjects(model); return new ModelAndView(new RedirectView(URL.makeAbsolutePath(URL.ARTICLE, title))); }
From source file:ch.cyberduck.core.sds.SDSDirectoryFeature.java
@Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { try {/*from ww w. j a v a 2 s . c o m*/ if (containerService.isContainer(folder)) { final CreateRoomRequest roomRequest = new CreateRoomRequest(); final UserAccountWrapper user = session.userAccount(); roomRequest.addAdminIdsItem(user.getId()); roomRequest.setAdminGroupIds(null); roomRequest.setName(folder.getName()); final Node r = new NodesApi(session.getClient()).createRoom(StringUtils.EMPTY, null, roomRequest); return new Path(folder.getParent(), folder.getName(), EnumSet.of(Path.Type.directory, Path.Type.volume), new PathAttributes(folder.attributes())); } else { final CreateFolderRequest folderRequest = new CreateFolderRequest(); folderRequest.setParentId(Long.parseLong(new SDSNodeIdProvider(session) .getFileid(folder.getParent(), new DisabledListProgressListener()))); folderRequest.setName(folder.getName()); final Node f = new NodesApi(session.getClient()).createFolder(StringUtils.EMPTY, folderRequest, null); return new Path(folder.getParent(), folder.getName(), folder.getType(), new PathAttributes(folder.attributes())); } } catch (ApiException e) { throw new SDSExceptionMappingService().map("Cannot create folder {0}", e, folder); } }
From source file:eu.europa.fisheries.uvms.rules.service.business.RulesValidatorTest.java
private void testi() { boolean fail = RandomUtils.nextInt(1, 100) % 2 == 0; String strToAddToFail = fail ? "abc" : StringUtils.EMPTY; FaArrivalFact abstrFact = new FaArrivalFact(); int addTo = RandomUtils.nextInt(1, 5); List<IdType> idList = new ArrayList<>(); IdType idType_1 = new IdType(); idType_1.setValue("ATEU0MAR00000"); idType_1.setSchemeId("ICCAT"); idList.add(idType_1);// w w w . jav a2 s . c o m IdType idType_2 = new IdType(); idType_2.setValue("MA201504"); idType_2.setSchemeId("EXT_MARK"); idList.add(idType_2); IdType idType_3 = new IdType(); idType_3.setValue("FW20150"); idType_3.setSchemeId("IRCS"); idList.add(idType_3); IdType idType_ = new IdType(); idType_.setValue("FRA201504172"); idType_.setSchemeId("CFR"); idList.add(idType_); IdType idType_4 = new IdType(); idType_4.setValue(UUID.randomUUID().toString()); idType_4.setSchemeId("UUID"); idList.add(idType_4); IdType idType_5 = new IdType(); idType_5.setValue(UUID.randomUUID().toString().toUpperCase()); idType_5.setSchemeId("UUID"); idList.add(idType_5); switch (addTo) { case 0: idType_.setValue(idType_.getValue() + strToAddToFail); case 1: idType_1.setValue(idType_1.getValue() + strToAddToFail); case 2: idType_2.setValue(idType_2.getValue() + strToAddToFail); case 3: idType_3.setValue(idType_3.getValue() + strToAddToFail); case 4: idType_4.setValue(idType_4.getValue() + strToAddToFail); case 5: idType_5.setValue(idType_5.getValue() + strToAddToFail); } final boolean trueFase = abstrFact.validateFormat(idList); if (fail) { assertTrue(trueFase); System.out.print("\n(It should fail) Result failed : " + trueFase); } else { assertFalse(trueFase); System.out.print("\n(It shouldn't fail) Result didn't fail : " + !trueFase); } }
From source file:com.tojc.ormlite.android.annotation.info.ContentMimeTypeVndInfoTest.java
public void testIsValidValue_returns_false_for_null_or_empty_package_or_class() { // given/*from w w w . jav a 2 s. c o m*/ contentMimeTypeVndInfo = new ContentMimeTypeVndInfo(null, null); // when // then assertFalse(contentMimeTypeVndInfo.isValidValue()); // -- // given contentMimeTypeVndInfo = new ContentMimeTypeVndInfo(null, TEST_TYPE); // when // then assertFalse(contentMimeTypeVndInfo.isValidValue()); // -- // given contentMimeTypeVndInfo = new ContentMimeTypeVndInfo(TEST_NAME, null); // when // then assertFalse(contentMimeTypeVndInfo.isValidValue()); // -- // given contentMimeTypeVndInfo = new ContentMimeTypeVndInfo(TEST_NAME, StringUtils.EMPTY); // when // then assertFalse(contentMimeTypeVndInfo.isValidValue()); // -- // given contentMimeTypeVndInfo = new ContentMimeTypeVndInfo(StringUtils.EMPTY, TEST_TYPE); // when // then assertFalse(contentMimeTypeVndInfo.isValidValue()); }
From source file:ch.cyberduck.core.exception.BackgroundException.java
public String getHelp() { return StringUtils.EMPTY; }
From source file:lineage2.gameserver.model.instances.residences.SiegeFlagInstance.java
/** * Method getTitle. * @return String */ @Override public String getTitle() { return StringUtils.EMPTY; }
From source file:de.jcup.egradle.codeassist.AbstractProposalImpl.java
public String getCode() { if (lazyBuilder == null) { return StringUtils.EMPTY; }/*from w ww .j a v a 2 s . co m*/ return lazyBuilder.getCode(this, getTextBeforeColumn()); }
From source file:fm.audiobox.tests.integration.network.UploadTests.java
/** * Test upload success.//from w w w. j av a 2s . c om * * @throws java.io.IOException the iO exception */ @Test @Ignore public void testUploadSuccess() throws IOException { File file = new File(this.getClass().getResource("/mpthreetest.mp3").getFile()); assertNotNull(file); assertTrue(file.exists()); prepareForStaging(); //c.authorize( fixtures.getString( "authentication.email" ), fixtures.getString( "authentication.password" ) ); c.getConf().setHttpTransport(new NetHttpTransport()); Upload u = c.newUpload(file); u.setListener(new NetworkProgressListener() { @Override public void onProgressUpdate(long total, long current) { assertTrue("Current progress cannot be bigger than total", total >= current); logger.info("Total: " + total + " | Actual: " + current); } }); MediaFile m = u.start(); try { assertEquals(StringUtils.EMPTY, m.getRemotePath()); } finally { assertTrue("File must be destroyed", m.destroy(c)); } }
From source file:com.aqnote.app.wifianalyzer.wifi.model.WiFiUtilsTest.java
@Test public void testConvertIpAddress() throws Exception { assertEquals("21.205.91.7", WiFiUtils.convertIpAddress(123456789)); assertEquals(StringUtils.EMPTY, WiFiUtils.convertIpAddress(1234)); }