bundles/org.eclipse.orion.client.cf/web/cfui/plugins/wizards/common/deploymentLogic.js
function uniqueLaunchConfigName(fileService, contentLocation, baseName) {
		return readLaunchConfigsFolder(fileService, contentLocation).then(function(children) {
			var counter = 0;
			for(var i=0; i<children.length; i++){
				var childName = children[i].Name.replace(/\.launch$/, ""); //$NON-NLS-0$
				if (baseName === childName){
					if (counter === 0) counter++;
					continue;
				}
				childName = childName.replace(baseName + "-", "");
				var launchConfCounter = parseInt(Number(childName), 10);
				if (!isNaN(launchConfCounter) && launchConfCounter >= counter)
					counter = launchConfCounter + 1;
			}
			return (counter > 0 ? baseName + "-" + counter : baseName);
		}, function(error){
			if (error.status === 404 || error.status === 410){
				return baseName;
			}
			throw error;
		});
	}
function uniqueLaunchConfigName(fileService, contentLocation, baseName) {
		return readLaunchConfigsFolder(fileService, contentLocation).then(function(children) {
			var counter = 0;
			for(var i=0; i<children.length; i++){
				var childName = children[i].Name.replace(/\.launch$/, ""); //$NON-NLS-0$
				if (baseName === childName){
					if (counter === 0) counter++;
					continue;
				}
				childName = childName.replace(baseName + "-", "");
				var launchConfCounter = parseInt(Number(childName), 10);
				if (!isNaN(launchConfCounter) && launchConfCounter >= counter)
					counter = launchConfCounter + 1;
			}
			return (counter > 0 ? baseName + "-" + counter : baseName);
		}, function(error){
			if (error.status === 404 || error.status === 410){
				return baseName;
			}
			throw error;
		});
	}
function uniqueLaunchConfigName ( fileService , contentLocation , baseName ) { return readLaunchConfigsFolder ( fileService , contentLocation ) . then ( function ( children ) { var counter = 0 ; for ( var i = 0 ; i < children . length ; i ++ ) { var childName = children [ i ] . Name . replace ( / \.launch$ / , "" ) ; //$NON-NLS-0$ if ( baseName === childName ) { if ( counter === 0 ) counter ++ ; continue ; } childName = childName . replace ( baseName + "-" , "" ) ; var launchConfCounter = parseInt ( Number ( childName ) , 10 ) ; if ( ! isNaN ( launchConfCounter ) && launchConfCounter >= counter ) counter = launchConfCounter + 1 ; } return ( counter > 0 ? baseName + "-" + counter : baseName ) ; } , function ( error ) { if ( error . status === 404 || error . status === 410 ) { return baseName ; } throw error ; } ) ; }
Calculates a uniqe name for the launch config
@returns {orion.Promise} resolving to String
Calculates a uniqe name for the launch config