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.inkubator.hrm.web.flow.EmployeeRestController.java
@RequestMapping(method = RequestMethod.GET, value = "/get_all") public @ResponseBody EmployeeRestHeader getAllData() { EmployeeRestHeader header = new EmployeeRestHeader(); List<EmployeeRestModel> listEmpData = new ArrayList<EmployeeRestModel>(); try {//w ww. ja v a 2 s . c o m listEmpData = empDataService.getAllDataRestModel(StringUtils.EMPTY); header.setStatus(0); header.setErrorMessage(""); header.setNumberOfProfiles(listEmpData.size()); header.setProfiles(listEmpData); } catch (Exception ex) { LOGGER.error("error", ex); header.setStatus(1); header.setErrorMessage(ex.getMessage()); } return header; }
From source file:ch.cyberduck.core.sds.SDSCopyFeature.java
@Override public Path copy(final Path source, final Path target, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { try {/*w w w. j a va 2s . c om*/ final Node node = new NodesApi(session.getClient()).copyNodes(StringUtils.EMPTY, // Target Parent Node ID Long.parseLong(new SDSNodeIdProvider(session).getFileid(target.getParent(), new DisabledListProgressListener())), new CopyNodesRequest() .addNodeIdsItem(Long.parseLong(new SDSNodeIdProvider(session).getFileid(source, new DisabledListProgressListener()))) .resolutionStrategy(CopyNodesRequest.ResolutionStrategyEnum.OVERWRITE), null); return new Path(target.getParent(), target.getName(), target.getType(), new PathAttributes(target.attributes()).withVersionId(String.valueOf(node.getId()))); } catch (ApiException e) { throw new SDSExceptionMappingService().map("Cannot copy {0}", e, source); } }
From source file:gobblin.util.PropertiesUtils.java
/** * Extract all the keys that start with a <code>prefix</code> in {@link Properties} to a new {@link Properties} * instance./* w ww . jav a 2 s . c o m*/ * * @param properties the given {@link Properties} instance * @param prefix of keys to be extracted * @return a {@link Properties} instance */ public static Properties extractPropertiesWithPrefix(Properties properties, Optional<String> prefix) { Preconditions.checkNotNull(properties); Preconditions.checkNotNull(prefix); Properties extractedProperties = new Properties(); for (Map.Entry<Object, Object> entry : properties.entrySet()) { if (StringUtils.startsWith(entry.getKey().toString(), prefix.or(StringUtils.EMPTY))) { extractedProperties.put(entry.getKey().toString(), entry.getValue()); } } return extractedProperties; }
From source file:com.github.haixing_hu.csl.Contributor.java
/** * Default constructs an {@link Contributor}. */ public Contributor() { name = StringUtils.EMPTY; email = null; uri = null; }
From source file:com.adobe.cq.wcm.core.components.testing.MockAdapterFactory.java
@Override @SuppressWarnings("unchecked") public <AdapterType> AdapterType getAdapter(Object o, Class<AdapterType> aClass) { if (aClass == ContentPolicyMapping.class && o instanceof Resource) { Resource resource = (Resource) o; ValueMap valueMap = resource.getValueMap(); String policyPath = valueMap.get("cq:policy", StringUtils.EMPTY); Resource policyMappingResource = null; if (StringUtils.isNotEmpty(policyPath)) { policyMappingResource = resource; } else {//from ww w . j av a2 s . c om PageManager pageManager = resource.getResourceResolver().adaptTo(PageManager.class); if (pageManager != null) { Page page = pageManager.getContainingPage(resource); if (page != null) { Template template = page.getTemplate(); if (template != null && page.getPath().startsWith(template.getPath() + "/")) { // in template; resolve relative to policies node policyPath = template.getPath() + "/policies/" + resource.getPath().replace(template.getPath() + "/structure/", ""); policyMappingResource = resource.getResourceResolver().getResource(policyPath); } } } } if (policyMappingResource != null) { return (AdapterType) new MockContentPolicyMapping(policyMappingResource); } } return null; }
From source file:de.micromata.genome.logging.DocLogEntries.java
/** * Load.//from ww w . j av a2s . c om * * @param properties the properties * @return the doc log entries */ @SuppressWarnings("unchecked") public static DocLogEntries load(Map properties) { Map<String, Object> props = properties; DocLogEntries dle = new DocLogEntries(); int i; for (i = 0; props.get("" + i + ".level") != null; ++i) { DocLogEntry dl = new DocLogEntry(); dl.setLevel(Objects.toString(props.get("" + i + ".level"), StringUtils.EMPTY)); dl.setDomain(Objects.toString(props.get("" + i + ".domain"), StringUtils.EMPTY)); dl.setCategory(Objects.toString(props.get("" + i + ".category"), StringUtils.EMPTY)); dl.setConstMessage(Objects.toString(props.get("" + i + ".message"), StringUtils.EMPTY)); dl.setReason(Objects.toString(props.get("" + i + ".reason"), StringUtils.EMPTY)); dl.setAction(Objects.toString(props.get("" + i + ".action"), StringUtils.EMPTY)); // log4jlog.debug("dl: " + dl.hashCode() + ": " + dl.toString()); DocLogEntryKey dlek = new DocLogEntryKey(dl); List<DocLogEntry> ldel = dle.entries.get(dlek); if (ldel == null) { ldel = new ArrayList<DocLogEntry>(); dle.entries.put(dlek, ldel); } else { /** * @nologging * @reason Conflict with duplicated DocLogs * @action Concact Developer */ //GLog.note(GenomeLogCategory.Configuration, "Duplicated doclog: " + dl.hashCode() + ": " + dl.toString()); // log4jlog.debug("fdl: x" + dl.hashCode() + ": " + dl.toString()); // ldel.add(dl); } ldel.add(dl); } return dle; }
From source file:com.omnigon.aem.handlebars.helpers.GetUniqueIdHelper.java
@Override public CharSequence apply(Object context, Options options) throws IOException { if (TagType.VAR == options.tagType || TagType.SUB_EXPRESSION == options.tagType) { int contextHashCode = context.hashCode(); String scriptPath = options.fn.filename(); String uniqueId = UniqueId.generateUniqueId(scriptPath + contextHashCode); return ID_PREFIX + StringUtils.substring(uniqueId, uniqueId.length() - ID_SIZE); }/*w w w .j a v a2s. co m*/ return StringUtils.EMPTY; }
From source file:com.github.haixing_hu.bean.PropertyDescriptorGroup.java
/** * Default constructor used by the JAXB. */ PropertyDescriptorGroup() { name = StringUtils.EMPTY; descriptors = new PropertyDescriptor[0]; }
From source file:com.ibasco.agql.protocols.valve.source.query.packets.request.SourceRconTermRequestPacket.java
public SourceRconTermRequestPacket() { super(SourceRconUtil.RCON_TERMINATOR_RID); setSize(0); setType(SourceRconRequestType.RESPONSE); setBody(StringUtils.EMPTY); }
From source file:de.jcup.egradle.codeassist.RelevantCodeCutter.java
/** * <pre>//from www . j a v a 2s .c o m element fi bb ^-- fi element fi bb ^-- fi element .fi bb ^--- .fi element fi bb ^--- empty element ^-- offset first character in line ^-- other: given offset 01234 678 0123 | |-- offset 0 ->right 0, left nothing! * </pre> * * @param code * when null always an empty string will be returned * @param offset * when negative always an empty string will be returned * @return relevant code or empty */ String getRelevantCode(String code, int offset) { if (code == null) { return StringUtils.EMPTY; } if (offset < 0) { return StringUtils.EMPTY; } String leftText = getLeftText(code, offset); String rightText = getRightText(code, offset); return leftText + rightText; }