Here is the code that I used. just use the space name that you want and the change the <actual-scape> to return the space to which you want to link to. hope this helps.
String spaceName = "Space";
String qname = QName.createValidLocalName(spaceName);
Map<QName, Serializable> dProps = new HashMap<QName, Serializable>(3);
dProps.put(ContentModel.PROP_NAME, spaceName);
dProps.put(ContentModel.PROP_LINK_DESTINATION, <actual-space>);
ChildAssociationRef assocRef = this.nodeService.createNode(
homeSpaceRef,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, qname),
ApplicationModel.TYPE_FOLDERLINK,
dProps);
NodeRef nodeRef = assocRef.getChildRef();
// set the name property on the node
this.nodeService.setProperty(nodeRef, ContentModel.PROP_NAME, spaceName);
if (logger.isDebugEnabled()) logger.debug("Created Space link with name: " + spaceName);
Map<QName, Serializable> props = new HashMap<QName, Serializable>(3);
props.put(ApplicationModel.PROP_ICON, CreateSpaceWizard.DEFAULT_SPACE_ICON_NAME);
props.put(ContentModel.PROP_TITLE, spaceName);
props.put(ContentModel.PROP_DESCRIPTION, spaceName);
this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, props);