本文整理匯總了Java中net.sourceforge.subsonic.util.StringUtil.split方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtil.split方法的具體用法?Java StringUtil.split怎麽用?Java StringUtil.split使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.sourceforge.subsonic.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.split方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAvailableThemes
import net.sourceforge.subsonic.util.StringUtil; //導入方法依賴的package包/類
/**
* Returns a list of available themes.
*
* @return A list of available themes.
*/
public synchronized Theme[] getAvailableThemes() {
if (themes == null) {
themes = new ArrayList<Theme>();
try {
InputStream in = SettingsService.class.getResourceAsStream(THEMES_FILE);
String[] lines = StringUtil.readLines(in);
for (String line : lines) {
String[] elements = StringUtil.split(line);
if (elements.length == 2) {
themes.add(new Theme(elements[0], elements[1]));
} else if (elements.length == 3) {
themes.add(new Theme(elements[0], elements[1], elements[2]));
} else {
LOG.warn("Failed to parse theme from line: [" + line + "].");
}
}
} catch (IOException x) {
LOG.error("Failed to resolve list of themes.", x);
themes.add(new Theme("default", "Subsonic default"));
}
}
return themes.toArray(new Theme[themes.size()]);
}
示例2: getAvailableThemes
import net.sourceforge.subsonic.util.StringUtil; //導入方法依賴的package包/類
/**
* Returns a list of available themes.
*
* @return A list of available themes.
*/
public synchronized Theme[] getAvailableThemes() {
if (themes == null) {
themes = new ArrayList<Theme>();
try {
InputStream in = SettingsService.class.getResourceAsStream(THEMES_FILE);
String[] lines = StringUtil.readLines(in);
for (String line : lines) {
String[] elements = StringUtil.split(line);
if (elements.length == 2) {
themes.add(new Theme(elements[0], elements[1]));
} else {
LOG.warn("Failed to parse theme from line: [" + line + "].");
}
}
} catch (IOException x) {
LOG.error("Failed to resolve list of themes.", x);
themes.add(new Theme("default", "Subsonic default"));
}
}
return themes.toArray(new Theme[themes.size()]);
}
示例3: parse
import net.sourceforge.subsonic.util.StringUtil; //導入方法依賴的package包/類
public static MediaLibraryStatistics parse(String s) {
try {
String[] strings = StringUtil.split(s);
return new MediaLibraryStatistics(
Integer.parseInt(strings[0]),
Integer.parseInt(strings[1]),
Integer.parseInt(strings[2]),
Integer.parseInt(strings[3]),
Integer.parseInt(strings[4]),
Integer.parseInt(strings[5]),
Integer.parseInt(strings[6]),
Integer.parseInt(strings[7]),
Long.parseLong(strings[8]),
Long.parseLong(strings[9]));
} catch (Exception e) {
LOG.warn("Failed to parse media library statistics: " + s);
return new MediaLibraryStatistics();
}
}
示例4: isTranscodingStepInstalled
import net.sourceforge.subsonic.util.StringUtil; //導入方法依賴的package包/類
private boolean isTranscodingStepInstalled(String step) {
if (StringUtils.isEmpty(step)) {
return true;
}
String executable = StringUtil.split(step)[0];
PrefixFileFilter filter = new PrefixFileFilter(executable);
String[] matches = getTranscodeDirectory().list(filter);
return matches != null && matches.length > 0;
}
示例5: parse
import net.sourceforge.subsonic.util.StringUtil; //導入方法依賴的package包/類
public static MediaLibraryStatistics parse(String s) {
try {
String[] strings = StringUtil.split(s);
return new MediaLibraryStatistics(
Integer.parseInt(strings[0]),
Integer.parseInt(strings[1]),
Integer.parseInt(strings[2]),
Long.parseLong(strings[3]),
Long.parseLong(strings[4]));
} catch (Exception e) {
LOG.warn("Failed to parse media library statistics: " + s);
return new MediaLibraryStatistics();
}
}
示例6: getShortcutsAsArray
import net.sourceforge.subsonic.util.StringUtil; //導入方法依賴的package包/類
public String[] getShortcutsAsArray() {
return StringUtil.split(getShortcuts());
}
示例7: getSourceFormatsAsArray
import net.sourceforge.subsonic.util.StringUtil; //導入方法依賴的package包/類
public String[] getSourceFormatsAsArray() {
return StringUtil.split(sourceFormats);
}