List of usage examples for org.apache.commons.lang3 StringUtils SPACE
String SPACE
To view the source code for org.apache.commons.lang3 StringUtils SPACE.
Click Source Link
From source file:com.epam.dlab.backendapi.core.commands.PythonCommand.java
@Override public String toCMD() { return PYTHON + fileName + StringUtils.SPACE + String.join(StringUtils.SPACE, options); }
From source file:cop.raml.utils.javadoc.JavaDocUtils.java
public static String clearMacros(String str) { if (StringUtils.isBlank(str)) return null; str = Macro.removeAll(str);//from w ww .ja va2s . co m str = TagLink.remove(str); // TODO link should not be deleted; should be modified str = HtmlTag.replaceAll(str); str = MULTIPLE_WHITESPACES.matcher(str).replaceAll(StringUtils.SPACE); str = Utils.trimLine(str); str = str.trim(); return str.isEmpty() ? null : str; }
From source file:com.netflix.genie.common.dto.JobTest.java
/** * Test to make sure can build a valid Job using the builder. *//*www.j av a2 s. c o m*/ @Test @SuppressWarnings("deprecation") public void canBuildJobDeprecatedConstructor() { final Job job = new Job.Builder(NAME, USER, VERSION, StringUtils.join(COMMAND_ARGS, StringUtils.SPACE)) .build(); Assert.assertThat(job.getName(), Matchers.is(NAME)); Assert.assertThat(job.getUser(), Matchers.is(USER)); Assert.assertThat(job.getVersion(), Matchers.is(VERSION)); Assert.assertThat(job.getCommandArgs().orElseThrow(IllegalArgumentException::new), Matchers.is(StringUtils.join(COMMAND_ARGS, StringUtils.SPACE))); Assert.assertFalse(job.getArchiveLocation().isPresent()); Assert.assertFalse(job.getClusterName().isPresent()); Assert.assertFalse(job.getCommandName().isPresent()); Assert.assertFalse(job.getFinished().isPresent()); Assert.assertFalse(job.getStarted().isPresent()); Assert.assertThat(job.getStatus(), Matchers.is(JobStatus.INIT)); Assert.assertFalse(job.getStatusMsg().isPresent()); Assert.assertFalse(job.getCreated().isPresent()); Assert.assertFalse(job.getDescription().isPresent()); Assert.assertFalse(job.getId().isPresent()); Assert.assertThat(job.getTags(), Matchers.empty()); Assert.assertFalse(job.getUpdated().isPresent()); Assert.assertThat(job.getRuntime(), Matchers.is(Duration.ZERO)); Assert.assertThat(job.getGrouping(), Matchers.is(Optional.empty())); Assert.assertThat(job.getGroupingInstance(), Matchers.is(Optional.empty())); }
From source file:cop.raml.utils.javadoc.Macro.java
public static String removeWithPattern(@NotNull Pattern pattern, String str) { return StringUtils.isNotBlank(str) ? pattern.matcher(str).replaceAll(StringUtils.SPACE) : str; }
From source file:ch.cyberduck.cli.TerminalHelpFormatter.java
protected StringBuffer renderWrappedText(final StringBuffer sb, final int width, int nextLineTabStop, String text) {/* w w w. j a va 2 s. c om*/ int pos = findWrapPos(text, width, 0); if (pos == -1) { sb.append(rtrim(text)); return sb; } sb.append(rtrim(text.substring(0, pos))).append(getNewLine()); if (nextLineTabStop >= width) { // stops infinite loop happening nextLineTabStop = 1; } // all following lines must be padded with nextLineTabStop space characters final String padding = createPadding(nextLineTabStop); while (true) { text = padding + StringUtils.removeStart(text.substring(pos), StringUtils.SPACE); pos = findWrapPos(text, width, 0); if (pos == -1) { sb.append(text); return sb; } if ((text.length() > width) && (pos == nextLineTabStop - 1)) { pos = width; } sb.append(rtrim(text.substring(0, pos))).append(getNewLine()); } }
From source file:com.netflix.genie.common.dto.JobRequestTest.java
/** * Test to make sure can build a valid JobRequest using the builder. *//*from w w w. ja v a2s. co m*/ @Test @SuppressWarnings("deprecation") public void canBuildJobRequestDeprecated() { final JobRequest request = new JobRequest.Builder(NAME, USER, VERSION, StringUtils.join(COMMAND_ARGS, StringUtils.SPACE), CLUSTER_CRITERIAS, COMMAND_CRITERIA).build(); Assert.assertThat(request.getName(), Matchers.is(NAME)); Assert.assertThat(request.getUser(), Matchers.is(USER)); Assert.assertThat(request.getVersion(), Matchers.is(VERSION)); Assert.assertThat(request.getCommandArgs().orElseThrow(IllegalArgumentException::new), Matchers.is(StringUtils.join(COMMAND_ARGS, StringUtils.SPACE))); Assert.assertThat(request.getClusterCriterias(), Matchers.is(CLUSTER_CRITERIAS)); Assert.assertThat(request.getCommandCriteria(), Matchers.is(COMMAND_CRITERIA)); Assert.assertFalse(request.getCpu().isPresent()); Assert.assertThat(request.isDisableLogArchival(), Matchers.is(false)); Assert.assertFalse(request.getEmail().isPresent()); Assert.assertThat(request.getConfigs(), Matchers.empty()); Assert.assertThat(request.getDependencies(), Matchers.empty()); Assert.assertFalse(request.getGroup().isPresent()); Assert.assertFalse(request.getMemory().isPresent()); Assert.assertFalse(request.getSetupFile().isPresent()); Assert.assertFalse(request.getCreated().isPresent()); Assert.assertFalse(request.getDescription().isPresent()); Assert.assertFalse(request.getId().isPresent()); Assert.assertThat(request.getTags(), Matchers.empty()); Assert.assertFalse(request.getUpdated().isPresent()); Assert.assertThat(request.getApplications(), Matchers.empty()); Assert.assertFalse(request.getTimeout().isPresent()); Assert.assertFalse(request.getGrouping().isPresent()); Assert.assertFalse(request.getGroupingInstance().isPresent()); }
From source file:ch.cyberduck.cli.TerminalStreamListener.java
private void increment() { final TransferProgress progress = meter.getStatus(); if (System.currentTimeMillis() - timestamp.get() < 100L) { if (!progress.isComplete()) { return; }//www .j av a 2 s . co m } try { lock.acquire(); final BigDecimal fraction; if (progress.getTransferred() == 0L) { fraction = BigDecimal.ZERO; } else { fraction = new BigDecimal(progress.getTransferred()).divide(new BigDecimal(progress.getSize()), 1, RoundingMode.DOWN); } console.printf("\r%s[", Ansi.ansi().saveCursorPosition().eraseLine(Ansi.Erase.ALL).restoreCursorPosition()); int i = 0; for (; i <= (int) (fraction.doubleValue() * width); i++) { console.printf("\u25AE"); } for (; i < width; i++) { console.printf(StringUtils.SPACE); } console.printf("] %s%s", progress.getProgress(), Ansi.ansi().reset()); timestamp.set(System.currentTimeMillis()); } catch (InterruptedException e) { // } finally { lock.release(); } }
From source file:com.cognifide.qa.bb.test.actions.BobcatActionsTest.java
@Test public void shouldContainTextAfterMultiLineSent() { //when//ww w.j a va2 s . c o m actions.sendKeys(inputElement, TEXT_TO_SEND, StringUtils.SPACE, TEXT_TO_SEND).perform(); //then assertThat(getTextFromInputElement()).isEqualTo(TEXT_TO_SEND + StringUtils.SPACE + TEXT_TO_SEND); }
From source file:io.knotx.assembler.FragmentAssemblerTest.java
@Test @KnotxConfiguration("test.unwrap.io.knotx.FragmentAssembler.json") public void callAssemblerWithEmptySnippet_expectNoContentStatus(TestContext context) throws Exception { callAssemblerWithAssertions(context, Collections.singletonList(new ImmutablePair<>(Collections.singletonList(RAW), StringUtils.SPACE)), knotContext -> context.assertEquals(HttpResponseStatus.NO_CONTENT.code(), knotContext.getClientResponse().getStatusCode())); }
From source file:com.cognifide.qa.bb.test.actions.BobcatActionsTest.java
@Test public void whenIPressBackSpaceLastLetterIsRemoved() { //when/*from w w w. j av a 2 s . c o m*/ actions.sendKeys(inputElement, TEXT_TO_SEND, StringUtils.SPACE, TEXT_TO_SEND, Keys.BACK_SPACE).perform(); //then assertThat(getTextFromInputElement()).endsWith(StringUtils.chop(TEXT_TO_SEND)); }