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:cherry.sqlman.tool.search.SearchServiceImpl.java
@Override public void afterPropertiesSet() { QSqlClause c = new QSqlClause("c"); QSqlStatement s = new QSqlStatement("s"); QSqlLoad l = new QSqlLoad("l"); StringExpression databaseName = cases() // .when(m.sqlType.eq(SqlType.CLAUSE.code())) // .then(new SQLSubQuery().from(c).where(c.id.eq(m.id)).unique(c.databaseName)) // .when(m.sqlType.eq(SqlType.STATEMENT.code())) // .then(new SQLSubQuery().from(s).where(s.id.eq(m.id)).unique(s.databaseName)) // .when(m.sqlType.eq(SqlType.LOAD.code())) // .then(new SQLSubQuery().from(l).where(l.id.eq(m.id)).unique(l.databaseName)) // .otherwise(StringUtils.EMPTY).as(getColumnMetadata(c.databaseName).getName()); List<Expression<?>> list = new ArrayList<>(m.all().length + 1); for (Path<?> e : m.all()) { list.add(e);/*ww w . ja va 2 s . co m*/ } list.add(databaseName); expressions = list.toArray(new Expression<?>[list.size()]); }
From source file:com.vrem.wifianalyzer.wifi.graph.channel.ChannelAxisLabelTest.java
@Test public void testXAxisWithUnknownFrequencyReturnEmptyString() throws Exception { WiFiChannels wiFiChannels = WiFiBand.GHZ2.getWiFiChannels(); WiFiChannel wiFiChannel = wiFiChannels.getWiFiChannelFirst(); assertEquals(StringUtils.EMPTY, fixture.formatLabel(wiFiChannel.getFrequency() - wiFiChannels.getFrequencyOffset(), true)); }
From source file:com.vrem.wifianalyzer.wifi.accesspoint.AccessPointDetailTest.java
@Test public void testMakeViewShouldCreateNewView() throws Exception { // setup/*from ww w . j a va 2 s . c om*/ WiFiDetail wiFiDetail = withWiFiDetail(SSID, new WiFiAdditional(StringUtils.EMPTY, true)); // execute View actual = fixture.makeView(null, null, wiFiDetail, false); // validate assertNotNull(actual); }
From source file:ch.cyberduck.core.azure.AzureObjectListService.java
@Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try {//from w ww . j a v a 2 s. co m final CloudBlobContainer container = session.getClient() .getContainerReference(containerService.getContainer(directory).getName()); final AttributedList<Path> children = new AttributedList<Path>(); ResultContinuation token = null; ResultSegment<ListBlobItem> result; String prefix = StringUtils.EMPTY; if (!containerService.isContainer(directory)) { prefix = containerService.getKey(directory); if (!prefix.endsWith(String.valueOf(Path.DELIMITER))) { prefix += Path.DELIMITER; } } do { final BlobRequestOptions options = new BlobRequestOptions(); result = container.listBlobsSegmented(prefix, false, EnumSet.noneOf(BlobListingDetails.class), PreferencesFactory.get().getInteger("azure.listing.chunksize"), token, options, context); for (ListBlobItem object : result.getResults()) { if (new Path(object.getUri().getPath(), EnumSet.of(Path.Type.directory)).equals(directory)) { continue; } final PathAttributes attributes = new PathAttributes(); if (object instanceof CloudBlob) { final CloudBlob blob = (CloudBlob) object; attributes.setSize(blob.getProperties().getLength()); attributes.setModificationDate(blob.getProperties().getLastModified().getTime()); attributes.setETag(blob.getProperties().getEtag()); if (StringUtils.isNotBlank(blob.getProperties().getContentMD5())) { attributes.setChecksum(Checksum.parse(Hex .encodeHexString(Base64.decodeBase64(blob.getProperties().getContentMD5())))); } } // A directory is designated by a delimiter character. final EnumSet<AbstractPath.Type> types = object instanceof CloudBlobDirectory ? EnumSet.of(Path.Type.directory, Path.Type.placeholder) : EnumSet.of(Path.Type.file); final Path child = new Path(directory, PathNormalizer.name(object.getUri().getPath()), types, attributes); children.add(child); } listener.chunk(directory, children); token = result.getContinuationToken(); } while (result.getHasMoreResults()); return children; } catch (StorageException e) { throw new AzureExceptionMappingService().map("Listing directory {0} failed", e, directory); } catch (URISyntaxException e) { throw new NotfoundException(e.getMessage(), e); } }
From source file:com.qcadoo.mes.cmmsMachineParts.hooks.PlannedEventHooks.java
public void onSave(final DataDefinition eventDD, final Entity event) { Entity owner = event.getBelongsToField(PlannedEventFields.OWNER); if (owner != null) { String person = Strings.nullToEmpty(owner.getStringField(StaffFields.NAME)) + " " + Strings.nullToEmpty(owner.getStringField(StaffFields.SURNAME)); event.setField(PlannedEventFields.OWNER_NAME, person); } else {//from w w w . j a va 2 s .c o m event.setField(PlannedEventFields.OWNER_NAME, StringUtils.EMPTY); } clearHiddenFields(event); }
From source file:com.vrem.wifianalyzer.wifi.ConnectionViewTest.java
@Test public void testUpdateWithConnection() throws Exception { // setup/*from w w w.j a va 2 s .c o m*/ WiFiDetail connection = withConnection(new WiFiAdditional(StringUtils.EMPTY, "IPADDRESS", 11)); when(wiFiData.getConnection()).thenReturn(connection); // execute fixture.update(wiFiData); // validate verify(activity).getResources(); verify(view).setVisibility(View.VISIBLE); verify(accessPointsDetail).setView(resources, view, connection, false, false); }
From source file:de.blizzy.documentr.markdown.HtmlSerializer.java
@Override public void visit(VerbatimNode node) { if (node instanceof VerbatimNodeWithType) { String title = ((VerbatimNodeWithType) node).getTitle(); if (StringUtils.isNotBlank(title)) { printer.print("<div class=\"code-view-title\">") //$NON-NLS-1$ .printEncoded(title.trim()).print("</div>"); //$NON-NLS-1$ }//from ww w . j av a 2 s . c o m } printer.print("<div class=\"code-view-wrapper\">" + //$NON-NLS-1$ "<!--__NOTRIM__--><div class=\"code-view\" data-text-range=\"") //$NON-NLS-1$ .print(String.valueOf(node.getStartIndex())).print(",").print(String.valueOf(node.getEndIndex())) //$NON-NLS-1$ .print("\""); //$NON-NLS-1$ if (node instanceof VerbatimNodeWithType) { String type = ((VerbatimNodeWithType) node).getType(); if (StringUtils.isNotBlank(type)) { printer.print(" data-type=\"").printEncoded(type.trim()).print("\""); //$NON-NLS-1$ //$NON-NLS-2$ } } printer.print(">") //$NON-NLS-1$ .printEncoded(node.getText().replaceFirst("[\\r\\n]*$", StringUtils.EMPTY)); //$NON-NLS-1$ printer.print("</div><!--__/NOTRIM__--></div>\n"); //$NON-NLS-1$ }
From source file:ch.cyberduck.core.transfer.upload.RenameExistingFilter.java
/** * Rename existing file on server if there is a conflict. *//*from w w w. j a v a 2 s.c o m*/ @Override public void apply(final Path file, final Local local, final TransferStatus status, final ProgressListener listener) throws BackgroundException { // Rename existing file before putting new file in place if (status.isExists()) { Path rename; do { final String proposal = MessageFormat.format( PreferencesFactory.get().getProperty("queue.upload.file.rename.format"), FilenameUtils.getBaseName(file.getName()), UserDateFormatterFactory.get().getMediumFormat(System.currentTimeMillis(), false) .replace(Path.DELIMITER, '-').replace(':', '-'), StringUtils.isNotBlank(file.getExtension()) ? String.format(".%s", file.getExtension()) : StringUtils.EMPTY); rename = new Path(file.getParent(), proposal, file.getType()); } while (find.find(rename)); if (log.isInfoEnabled()) { log.info(String.format("Rename existing file %s to %s", file, rename)); } move.move(file, rename, new TransferStatus().exists(false), new Delete.DisabledCallback(), new DisabledConnectionCallback()); if (log.isDebugEnabled()) { log.debug(String.format("Clear exist flag for file %s", file)); } status.setExists(false); } super.apply(file, local, status, listener); }
From source file:de.blizzy.backup.vfs.RemoteLocation.java
@Override public int hashCode() { return host.hashCode() ^ port ^ ((login != null) ? login.hashCode() : StringUtils.EMPTY.hashCode()) ^ ((password != null) ? password.hashCode() : StringUtils.EMPTY.hashCode()) ^ folder.hashCode(); }
From source file:ch.sentric.QueryFactoryTest.java
@Test public void buildShouldRemoveGoogleUrlTrackingParameter() { final Query query = new QueryFactory().build( "utm_campaign=Feed%3A+TheSouthwesternSunRss+%28The+Southwestern+Sun+RSS%29&utm_medium=feed&utm_source=feedburner"); assertEquals(StringUtils.EMPTY, query.getAsSortedString()); }