當前位置: 首頁>>代碼示例>>Java>>正文


Java SettingsService.getSubsonicHome方法代碼示例

本文整理匯總了Java中net.sourceforge.subsonic.service.SettingsService.getSubsonicHome方法的典型用法代碼示例。如果您正苦於以下問題:Java SettingsService.getSubsonicHome方法的具體用法?Java SettingsService.getSubsonicHome怎麽用?Java SettingsService.getSubsonicHome使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.sourceforge.subsonic.service.SettingsService的用法示例。


在下文中一共展示了SettingsService.getSubsonicHome方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getImageCacheDirectory

import net.sourceforge.subsonic.service.SettingsService; //導入方法依賴的package包/類
private synchronized File getImageCacheDirectory(int size) {
    File dir = new File(SettingsService.getSubsonicHome(), "thumbs");
    dir = new File(dir, String.valueOf(size));
    if (!dir.exists()) {
        if (dir.mkdirs()) {
            LOG.info("Created thumbnail cache " + dir);
        } else {
            LOG.error("Failed to create thumbnail cache " + dir);
        }
    }

    return dir;
}
 
開發者ID:sindremehus,項目名稱:subsonic,代碼行數:14,代碼來源:CoverArtController.java

示例2: createDataSource

import net.sourceforge.subsonic.service.SettingsService; //導入方法依賴的package包/類
private DataSource createDataSource() {
    File subsonicHome = SettingsService.getSubsonicHome();
    DriverManagerDataSource ds = new DriverManagerDataSource();
    ds.setDriverClassName("org.hsqldb.jdbcDriver");
    ds.setUrl("jdbc:hsqldb:file:" + subsonicHome.getPath() + "/db/subsonic");
    ds.setUsername("sa");
    ds.setPassword("");

    return ds;
}
 
開發者ID:sindremehus,項目名稱:subsonic,代碼行數:11,代碼來源:HsqlDaoHelper.java

示例3: afterPropertiesSet

import net.sourceforge.subsonic.service.SettingsService; //導入方法依賴的package包/類
public void afterPropertiesSet() throws Exception {
    Configuration configuration = ConfigurationFactory.parseConfiguration();

    // Override configuration to make sure cache is stored in Subsonic home dir.
    File cacheDir = new File(SettingsService.getSubsonicHome(), "cache");
    configuration.getDiskStoreConfiguration().setPath(cacheDir.getPath());

    cacheManager = CacheManager.create(configuration);
}
 
開發者ID:sindremehus,項目名稱:subsonic,代碼行數:10,代碼來源:CacheFactory.java

示例4: doFilter

import net.sourceforge.subsonic.service.SettingsService; //導入方法依賴的package包/類
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
        throws IOException, ServletException {

    // Already verified?
    if (subsonicHomeVerified) {
        chain.doFilter(req, res);
        return;
    }

    File home = SettingsService.getSubsonicHome();
    if (!directoryExists(home)) {
        error(res, "<p>The directory <b>" + home + "</b> does not exist. Please create it and make it writable, " +
                   "then restart the servlet container.</p>" +
                   "<p>(You can override the directory location by specifying -Dsubsonic.home=... when " +
                   "starting the servlet container.)</p>");

    } else if (!directoryWritable(home)) {
        error(res, "<p>The directory <b>" + home + "</b> is not writable. Please change file permissions, " +
                   "then restart the servlet container.</p>" +
                   "<p>(You can override the directory location by specifying -Dsubsonic.home=... when " +
                   "starting the servlet container.)</p>");

    } else {
        subsonicHomeVerified = true;
        logServerInfo(req);
        chain.doFilter(req, res);
    }
}
 
開發者ID:sindremehus,項目名稱:subsonic,代碼行數:29,代碼來源:BootstrapVerificationFilter.java

示例5: createDataSource

import net.sourceforge.subsonic.service.SettingsService; //導入方法依賴的package包/類
private DataSource createDataSource() {
	
    File subsonicHome = SettingsService.getSubsonicHome();
    DriverManagerDataSource ds = new DriverManagerDataSource();
    
    ds.setDriverClassName("org.hsqldb.jdbcDriver");
    ds.setUrl("jdbc:hsqldb:file:" + subsonicHome.getPath() + "/db/subsonic");
    ds.setUsername("sa");
    ds.setPassword("");

    return ds;
}
 
開發者ID:FutureSonic,項目名稱:FutureSonic-Server,代碼行數:13,代碼來源:DaoHelper.java

示例6: doFilter

import net.sourceforge.subsonic.service.SettingsService; //導入方法依賴的package包/類
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
        throws IOException, ServletException {

    // Already verified?
    if (subsonicHomeVerified) {
        chain.doFilter(req, res);
        return;
    }

    File home = SettingsService.getSubsonicHome();
    if (!directoryExists(home)) {
        error(res, "<p>The directory <b>" + home + "</b> does not exist. Please create it and make it writable, " +
                   "then restart the servlet container.</p>" +
                   "<p>(You can override the directory location by specifying -Dsubsonic.home=... when " +
                   "starting the servlet container.)</p>");

    } else if (!directoryWritable(home)) {
        error(res, "<p>The directory <b>" + home + "</b> is not writable. Please change file permissions, " +
                   "then restart the servlet container.</p>" +
                   "<p>(You can override the directory location by specifying -Dsubsonic.home=... when " +
                   "starting the servlet container.)</p>");

    } else {
        subsonicHomeVerified = true;
        chain.doFilter(req, res);
    }
}
 
開發者ID:FutureSonic,項目名稱:FutureSonic-Server,代碼行數:28,代碼來源:BootstrapVerificationFilter.java


注:本文中的net.sourceforge.subsonic.service.SettingsService.getSubsonicHome方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。