List of usage examples for org.apache.commons.lang StringUtils EMPTY
String EMPTY
To view the source code for org.apache.commons.lang StringUtils EMPTY.
Click Source Link
""
. From source file:com.amalto.core.load.context.DefaultMetadata.java
public String getSP() { return StringUtils.EMPTY; }
From source file:com.seitenbau.jenkins.plugins.dynamicparameter.StringParameterDefinitionTest.java
/** Set-up method. */ @Before/* w w w.ja v a 2 s .c om*/ public final void setUp() { stringParameterDefinition = new StringParameterDefinition("test", SCRIPT, "desc", null, false, StringUtils.EMPTY); }
From source file:edu.northwestern.bioinformatics.studycalendar.web.template.ImportTemplateXmlCommandTest.java
public void testValidate() throws Exception { expect(file.isEmpty()).andReturn(true); replayMocks();//www .j a v a2s. c o m BindException errors = new BindException(file, StringUtils.EMPTY); command.validate(errors); verifyMocks(); assertTrue(errors.hasErrors()); assertEquals("Wrong error count", 1, errors.getErrorCount()); assertEquals("Wrong error code", "error.template.xml.not.specified", errors.getGlobalError().getCode()); }
From source file:net.sourceforge.ajaxtags.xml.AjaxTreeXmlBuilderTest.java
/** * Test method for {@link AjaxTreeXmlBuilder#addItem(String, String)} . *///from w w w . ja v a 2s .c om @Test public void testAddItemStringString() { xml.addItem("name1", "value"); assertEquals(AjaxTreeXmlBuilder.RESPONSE_START + "<item><name>name1</name><value>value</value></item>" + AjaxTreeXmlBuilder.RESPONSE_END, xml.getXMLString()); xml.addItem("name2", StringUtils.EMPTY); assertEquals( AjaxTreeXmlBuilder.RESPONSE_START + "<item><name>name1</name><value>value</value></item>" + "<item><name>name2</name><value></value></item>" + AjaxTreeXmlBuilder.RESPONSE_END, xml.getXMLString()); xml.addItem("name3", null); assertEquals( AjaxTreeXmlBuilder.RESPONSE_START + "<item><name>name1</name><value>value</value></item>" + "<item><name>name2</name><value></value></item>" + "<item><name>name3</name><value>null</value></item>" + AjaxTreeXmlBuilder.RESPONSE_END, xml.getXMLString()); }
From source file:com.mirth.connect.server.mule.adaptors.DICOMAdaptor.java
@Override protected void populateMessage(boolean emptyFilterAndTransformer) throws AdaptorException { messageObject.setRawDataProtocol(MessageObject.Protocol.DICOM); messageObject.setTransformedDataProtocol(MessageObject.Protocol.XML); messageObject.setEncodedDataProtocol(MessageObject.Protocol.DICOM); try {//from w w w. j a va 2 s . c om // Set transformed data DICOMSerializer dicomSerializer = (DICOMSerializer) serializer; String message = dicomSerializer.toXML(source); messageObject.setTransformedData(message); // Set rawdata on messageobject without attachment data if (dicomSerializer.getRawData() != null) { messageObject.setRawData(dicomSerializer.getRawData()); } else { messageObject.setRawData(StringUtils.EMPTY); } // Set source data to the new raw data which does not include the attachments // If the source is used after this point it will no longer have any attachment data. source = messageObject.getRawData(); // Create attachment if (dicomSerializer.getPixelData() != null && !dicomSerializer.getPixelData().isEmpty()) { Attachment attachment = new Attachment(); attachment.setType("DICOM"); MessageObjectController messageObjectController = ControllerFactory.getFactory() .createMessageObjectController(); messageObjectController.setAttachmentMessageId(messageObject, attachment); for (String image : dicomSerializer.getPixelData()) { attachment.setAttachmentId(UUIDGenerator.getUUID()); attachment.setData(image.getBytes()); attachment.setSize(image.length()); messageObjectController.insertAttachment(attachment); } messageObject.setAttachment(true); } populateMetadataFromXML(message); } catch (Exception e) { handleException(e); } if (emptyFilterAndTransformer) { messageObject.setEncodedData(source); } }
From source file:com.amalto.core.history.action.NoOpAction.java
public String getDetails() { return StringUtils.EMPTY; }
From source file:com.microsoft.alm.plugin.idea.common.ui.workitem.WorkItemHelper.java
public static String getFieldValue(@NotNull final WorkItem item, @NotNull final String fieldName) { final HashMap<String, Object> fieldMap = item.getFields(); if (fieldMap != null) { // Try a case sensitive search using the Map, // but if that doesn't work, loop through all the fields if (fieldMap.containsKey(fieldName)) { Object value = fieldMap.get(fieldName); if (value != null) { return value.toString(); }/*from w w w . java 2 s . c om*/ } else { for (final Map.Entry<String, Object> entry : fieldMap.entrySet()) { if (fieldName.equalsIgnoreCase(entry.getKey())) { if (entry.getValue() != null) { return entry.getValue().toString(); } } } } } return StringUtils.EMPTY; }
From source file:com.microsoft.alm.plugin.idea.git.ui.checkout.GitCheckoutModel.java
@Override public String getRepositoryName(final ServerContext context) { return (context != null && context.getGitRepository() != null) ? context.getGitRepository().getName() : StringUtils.EMPTY; }
From source file:com.amalto.core.save.AutoCommitSaverContext.java
@Override public String getPartialUpdateKey() { return StringUtils.EMPTY; }
From source file:com.comcast.viper.flume2storm.zookeeper.ZkTestUtils.java
/** * Utility function to send a command to the internal server. ZK servers * accepts 4 byte command strings to test their liveness. *///from w w w. j a v a 2 s.c om protected static String send4LetterWord(final String host, final int port, final String cmd) { Preconditions.checkArgument(cmd.length() == 4); try { final Socket sock = new Socket(host, port); OutputStream outstream = null; BufferedReader reader = null; try { outstream = sock.getOutputStream(); outstream.write(cmd.getBytes()); outstream.flush(); reader = new BufferedReader(new InputStreamReader(sock.getInputStream())); final StringBuilder sb = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } return sb.toString(); } finally { if (outstream != null) { outstream.close(); } sock.close(); if (reader != null) { reader.close(); } } } catch (final Exception e) { System.out.println(e.getMessage()); return StringUtils.EMPTY; } }