blob: 4bd4091865d9489d20842b57576cc5bdd3abbf1f [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.runtime.common.session;
public class SessionUtil {
private SessionUtil(){
}
/**
* Splits the fragment by "," and returns the encoded info. Returns null, if no fragment available.
* @param fragment
* @return
*/
public static Info getFragmentInfo(String fragment){
if(fragment == null){
return null;
}
String[] tokens = fragment.split("-");
if(tokens.length == 1) {
return null;
}
return new Info(tokens[0], tokens[1]);
}
public static class Info {
public final String host;
public final String ui;
public Info(String host, String ui) {
super();
this.host = host;
this.ui = ui;
}
}
}