Java Code Examples for org.apache.commons.lang.StringUtils.remove()

The following are Jave code examples for showing how to use remove() of the org.apache.commons.lang.StringUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: convertigo-engine   File: MobileApplication.java   Source Code and License Vote up 6 votes
public String getComputedApplicationId() {
	String applicationId = this.applicationId;
	if ("".equals(applicationId)) {
		applicationId = "com.convertigo.mobile." + getProject().getName();
	}
	else {
		// The user can have setup an application ID that could be non valid:
		// application ID can only contains alpha numeric ASCII characters.
		String[] applicationIdParts = applicationId.split("\\.");
		for (int i = 0; i < applicationIdParts.length; i++) {
			applicationIdParts[i] = com.twinsoft.convertigo.engine.util.StringUtils.normalize(applicationIdParts[i]);
			applicationIdParts[i] = StringUtils.remove(applicationIdParts[i], "_");
		}
		applicationId = com.twinsoft.convertigo.engine.util.StringUtils.join(applicationIdParts, ".");
	}
	return applicationId;
}
 
Example 2
Project: Hydrograph   File: BuildExpressionEditorDataSturcture.java   Source Code and License Vote up 6 votes
private void loadClassesFromSettingsFolder() {
	Properties properties = new Properties();
	IFolder folder=getCurrentProject().getFolder(PathConstant.PROJECT_RESOURCES_FOLDER);
	IFile file = folder.getFile(PathConstant.EXPRESSION_EDITOR_EXTERNAL_JARS_PROPERTIES_FILES);
	try {
		LOGGER.debug("Loading property file");
		if (file.getLocation().toFile().exists()) {
			FileInputStream inStream = new FileInputStream(file.getLocation().toString());
			properties.load(inStream);
			
			for(Object key:properties.keySet()){
				String packageName=StringUtils.remove((String)key,Constants.DOT+Constants.ASTERISK);
				if(StringUtils.isNotBlank(properties.getProperty((String)key)) && StringUtils.isNotBlank(packageName)){
					loadUserDefinedClassesInClassRepo(properties.getProperty((String)key),packageName);
				}
			}
		}
	} catch (IOException |RuntimeException exception) {
		LOGGER.error("Exception occurred while loading jar files from projects setting folder",exception);
	}
}
 
Example 3
Project: Hydrograph   File: ImportedSchemaPropagation.java   Source Code and License Vote up 5 votes
private ComponentsOutputSchema getComponentOutputSchemaFromInputPort(Component component, String inputPortId) {
	inputPortId = StringUtils.remove(inputPortId, Constants.COPY_FROM_INPUT_PORT_PROPERTY);
	ComponentsOutputSchema componentsOutputSchema = null;
	for (Link link : component.getTargetConnections()) {
		if (StringUtils.equalsIgnoreCase(link.getTargetTerminal(), inputPortId)) {
			componentsOutputSchema = SchemaPropagation.INSTANCE.getComponentsOutputSchema(link);
		}
	}
	return componentsOutputSchema;
}
 
Example 4
Project: Hydrograph   File: ExpressionEditorUtil.java   Source Code and License Vote up 5 votes
public String lastString(String field, String seperator) {
	String result = Constants.EMPTY_STRING;
	if (StringUtils.isNotBlank(field)) {
		String[] strArray = StringUtils.split(field, seperator);
		result = strArray[strArray.length - 1];
		if (StringUtils.endsWith(result, Constants.SEMICOLON)) {
			result = StringUtils.remove(result, Constants.SEMICOLON);
		}
	}
	return result;
}
 
Example 5
Project: Hydrograph   File: SubjobUtility.java   Source Code and License Vote up 5 votes
private String getPortIndex(Link link) {
		if(StringUtils.startsWithIgnoreCase(link.getSourceTerminal(), Constants.INPUT_SOCKET_TYPE)){
			return StringUtils.remove(link.getSourceTerminal(), Constants.INPUT_SOCKET_TYPE);
		}else {
			return StringUtils.remove(link.getSourceTerminal(), Constants.OUTPUT_SOCKET_TYPE);
		}
	
}
 
Example 6
Project: Hydrograph   File: OutputRecordCountUtility.java   Source Code and License Vote up 5 votes
private String getPortCount(String sourceTerminalId) {
	String portCount=null;
	if(StringUtils.startsWithIgnoreCase(sourceTerminalId, Constants.UNUSED_SOCKET_TYPE)){
		portCount=StringUtils.remove(sourceTerminalId, Constants.UNUSED_SOCKET_TYPE);
	}else if(StringUtils.startsWithIgnoreCase(sourceTerminalId, Constants.OUTPUT_SOCKET_TYPE)){
		portCount=StringUtils.remove(sourceTerminalId, Constants.OUTPUT_SOCKET_TYPE);
	}
	return portCount;
}
 
Example 7
Project: Hydrograph   File: JoinMapDialog.java   Source Code and License Vote up 5 votes
private void populateJoinMapDialog() {

		if (joinMappingGrid.getLookupMapProperties() != null
				&& !joinMappingGrid.getLookupMapProperties().isEmpty()) {
			mappingTableItemList = joinMappingGrid.getLookupMapProperties();
		} else {
			mappingTableItemList = new LinkedList<>();
		}

		if (joinMappingGrid.getButtonText() != null
				&& !StringUtils.equals(joinMappingGrid.getButtonText(), NO_COPY)) {
			radioButtonMap.get(joinMappingGrid.getButtonText()).setSelection(
					true);
			mappingTableViewer.getTable().setEnabled(false);
			enableMappingTableButtonPanel(false);
			String inputPortID=StringUtils.remove(joinMappingGrid.getButtonText(), Constants.COPY_FROM_INPUT_PORT_PROPERTY);
			copyFieldsWhenCopyOfIsSelected(inputPorts.get(Integer.parseInt(StringUtils.remove(inputPortID, Constants.INPUT_SOCKET_TYPE))), inputPortID);
			

		} else {
			radioButtonMap.get(NO_COPY).setSelection(true);
		}

		mappingTableViewer.setInput(mappingTableItemList);

		mappingTableViewer.refresh();

		populatePreviousItemsOfTable();
		
		mouseDoubleClick();
	}
 
Example 8
Project: Hydrograph   File: SchemaPropagation.java   Source Code and License Vote up 5 votes
private String getPortIndex(Link link) {
	if(StringUtils.startsWithIgnoreCase(link.getSourceTerminal(), Constants.INPUT_SOCKET_TYPE)){
		return StringUtils.remove(link.getSourceTerminal(), Constants.INPUT_SOCKET_TYPE);
	}else {
		return StringUtils.remove(link.getSourceTerminal(), Constants.OUTPUT_SOCKET_TYPE);
	}

}
 
Example 9
Project: Hydrograph   File: PreStartActivity.java   Source Code and License Vote up 5 votes
private static boolean checkJDKVersion(String jdkVersion,boolean showPopupAndExit) {
	jdkVersion=StringUtils.removeStart(jdkVersion, "jdk");
	jdkVersion =StringUtils.remove(jdkVersion, ".");
	jdkVersion=StringUtils.remove(jdkVersion, "_");
	long version=Long.parseLong(jdkVersion);
	if(version>=REQUIRED_JDK_VERSION){
		return true; 
	}
	if(showPopupAndExit){
		showInvalidJavaHomeDialogAndExit();
	}
	return false;
}
 
Example 10
Project: Hydrograph   File: GraphPropertiesHandler.java   Source Code and License Vote up 5 votes
private  String getCurrentGraphName()
{
	String graphName= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput().getName();
	graphName = StringUtils.remove(graphName, Constants.JOB_EXTENSION);
	graphName = StringUtils.abbreviate(graphName, 20);
	return graphName;
}
 
Example 11
Project: atlas   File: NativeSoUtils.java   Source Code and License Vote up 2 votes
/**
 * Acquisition relative path
 *
 * @param baseDir
 * @param file
 * @return
 */
public static String getRelativePath(File baseDir, File file) {
    return StringUtils.remove(file.getAbsolutePath(), baseDir.getAbsolutePath());
}