| /** |
| * 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 ISession.DTO_SEPARATOR 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(ISession.DTO_SEPARATOR); |
| 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; |
| } |
| } |
| } |