diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java deleted file mode 100644 index 2d6a9e557..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.core.helpers; - -import java.util.ArrayList; -import java.util.List; - -public class StringHelper { - - public static String[] EMPTY_ARRAY = new String[0]; - - public static String[] getArrayFromString(String spec, char c) { - String[] resultArr = EMPTY_ARRAY; - if (spec != null) { - int splitIdx = spec.indexOf(c); - if (splitIdx <= 0) { - spec = spec.trim(); - if (spec.length() > 0) - resultArr = new String[] {spec}; - } else { - List<String> result = new ArrayList<String>(); - while (splitIdx >= 0) { - String part = spec.substring(0, splitIdx).trim(); - if (part.length() > 0) - result.add(part); - spec = spec.substring(splitIdx + 1); - splitIdx = spec.indexOf(c); - } - spec = spec.trim(); - if (spec.length() > 0) - result.add(spec); - resultArr = result.toArray(new String[result.size()]); - } - } - return resultArr; - } -} |