本文整理匯總了Java中net.sourceforge.subsonic.service.ServiceLocator類的典型用法代碼示例。如果您正苦於以下問題:Java ServiceLocator類的具體用法?Java ServiceLocator怎麽用?Java ServiceLocator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ServiceLocator類屬於net.sourceforge.subsonic.service包,在下文中一共展示了ServiceLocator類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isApplicable
import net.sourceforge.subsonic.service.ServiceLocator; //導入依賴的package包/類
/**
* Returns whether this parser is applicable to the given file.
*
* @param file The file in question.
* @return Whether this parser is applicable to the given file.
*/
@Override
public boolean isApplicable(File file) {
String format = FilenameUtils.getExtension(file.getName()).toLowerCase();
for (String s : ServiceLocator.getSettingsService().getVideoFileTypesAsArray()) {
if (format.equals(s)) {
return true;
}
}
return false;
}
示例2: isRoot
import net.sourceforge.subsonic.service.ServiceLocator; //導入依賴的package包/類
private boolean isRoot(File file) {
SettingsService settings = ServiceLocator.getSettingsService();
List<MusicFolder> folders = settings.getAllMusicFolders(false, true);
for (MusicFolder folder : folders) {
if (file.equals(folder.getPath())) {
return true;
}
}
return false;
}