Java 类org.springframework.boot.ApplicationHome 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AbstractEmbeddedServletContainerFactory.java   
protected final File getValidSessionStoreDir(boolean mkdirs) {
    File dir = getSessionStoreDir();
    if (dir == null) {
        return new ApplicationTemp().getDir("servlet-sessions");
    }
    if (!dir.isAbsolute()) {
        dir = new File(new ApplicationHome().getDir(), dir.getPath());
    }
    if (!dir.exists() && mkdirs) {
        dir.mkdirs();
    }
    Assert.state(!mkdirs || dir.exists(), "Session dir " + dir + " does not exist");
    Assert.state(!dir.isFile(), "Session dir " + dir + " points to a file");
    return dir;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AbstractEmbeddedServletContainerFactoryTests.java   
@Test
public void getValidSessionStoreWhenSessionStoreIsRelative() throws Exception {
    AbstractEmbeddedServletContainerFactory factory = getFactory();
    factory.setSessionStoreDir(new File("sessions"));
    File dir = factory.getValidSessionStoreDir(false);
    assertThat(dir.getName()).isEqualTo("sessions");
    assertThat(dir.getParentFile()).isEqualTo(new ApplicationHome().getDir());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AtomikosJtaConfiguration.java   
private String getLogBaseDir() {
    if (StringUtils.hasLength(this.jtaProperties.getLogDir())) {
        return this.jtaProperties.getLogDir();
    }
    File home = new ApplicationHome().getDir();
    return new File(home, "transaction-logs").getAbsolutePath();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:BitronixJtaConfiguration.java   
private File getLogBaseDir() {
    if (StringUtils.hasLength(this.jtaProperties.getLogDir())) {
        return new File(this.jtaProperties.getLogDir());
    }
    File home = new ApplicationHome().getDir();
    return new File(home, "transaction-logs");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:NarayanaJtaConfiguration.java   
private File getLogDir() {
    if (StringUtils.hasLength(this.jtaProperties.getLogDir())) {
        return new File(this.jtaProperties.getLogDir());
    }
    File home = new ApplicationHome().getDir();
    return new File(home, "transaction-logs");
}
项目:spring-boot-concourse    文件:AbstractEmbeddedServletContainerFactory.java   
protected final File getValidSessionStoreDir(boolean mkdirs) {
    File dir = getSessionStoreDir();
    if (dir == null) {
        return new ApplicationTemp().getDir("servlet-sessions");
    }
    if (!dir.isAbsolute()) {
        dir = new File(new ApplicationHome().getDir(), dir.getPath());
    }
    if (!dir.exists() && mkdirs) {
        dir.mkdirs();
    }
    Assert.state(!mkdirs || dir.exists(), "Session dir " + dir + " does not exist");
    Assert.state(!dir.isFile(), "Session dir " + dir + " points to a file");
    return dir;
}
项目:spring-boot-concourse    文件:AbstractEmbeddedServletContainerFactoryTests.java   
@Test
public void getValidSessionStoreWhenSessionStoreIsRelative() throws Exception {
    AbstractEmbeddedServletContainerFactory factory = getFactory();
    factory.setSessionStoreDir(new File("sessions"));
    File dir = factory.getValidSessionStoreDir(false);
    assertThat(dir.getName()).isEqualTo("sessions");
    assertThat(dir.getParentFile()).isEqualTo(new ApplicationHome().getDir());
}
项目:spring-boot-concourse    文件:AtomikosJtaConfiguration.java   
private String getLogBaseDir() {
    if (StringUtils.hasLength(this.jtaProperties.getLogDir())) {
        return this.jtaProperties.getLogDir();
    }
    File home = new ApplicationHome().getDir();
    return new File(home, "transaction-logs").getAbsolutePath();
}
项目:spring-boot-concourse    文件:BitronixJtaConfiguration.java   
private File getLogBaseDir() {
    if (StringUtils.hasLength(this.jtaProperties.getLogDir())) {
        return new File(this.jtaProperties.getLogDir());
    }
    File home = new ApplicationHome().getDir();
    return new File(home, "transaction-logs");
}
项目:spring-boot-concourse    文件:NarayanaJtaConfiguration.java   
private File getLogDir() {
    if (StringUtils.hasLength(this.jtaProperties.getLogDir())) {
        return new File(this.jtaProperties.getLogDir());
    }
    File home = new ApplicationHome().getDir();
    return new File(home, "transaction-logs");
}
项目:contestparser    文件:AbstractEmbeddedServletContainerFactory.java   
protected final File getValidSessionStoreDir(boolean mkdirs) {
    File dir = getSessionStoreDir();
    if (dir == null) {
        return new ApplicationTemp().getDir("servlet-sessions");
    }
    if (!dir.isAbsolute()) {
        dir = new File(new ApplicationHome().getDir(), dir.getPath());
    }
    if (!dir.exists() && mkdirs) {
        dir.mkdirs();
    }
    Assert.state(!mkdirs || dir.exists(), "Session dir " + dir + " does not exist");
    Assert.state(!dir.isFile(), "Session dir " + dir + " points to a file");
    return dir;
}
项目:contestparser    文件:AbstractEmbeddedServletContainerFactoryTests.java   
@Test
public void getValidSessionStoreWhenSessionStoreIsRelative() throws Exception {
    AbstractEmbeddedServletContainerFactory factory = getFactory();
    factory.setSessionStoreDir(new File("sessions"));
    File dir = factory.getValidSessionStoreDir(false);
    assertThat(dir.getName(), equalTo("sessions"));
    assertThat(dir.getParentFile(), equalTo(new ApplicationHome().getDir()));
}
项目:contestparser    文件:AtomikosJtaConfiguration.java   
private String getLogBaseDir() {
    if (StringUtils.hasLength(this.jtaProperties.getLogDir())) {
        return this.jtaProperties.getLogDir();
    }
    File home = new ApplicationHome().getDir();
    return new File(home, "transaction-logs").getAbsolutePath();
}
项目:contestparser    文件:BitronixJtaConfiguration.java   
private File getLogBaseDir() {
    if (StringUtils.hasLength(this.jtaProperties.getLogDir())) {
        return new File(this.jtaProperties.getLogDir());
    }
    File home = new ApplicationHome().getDir();
    return new File(home, "transaction-logs");
}
项目:Exomiser    文件:MainConfig.java   
/**
 * Used to find the Path the Main application is running on in order to
 * pick-up the user-configured properties files.
 *
 * @return
 */
@Bean
public Path exomiserHome() {
    ApplicationHome home = new ApplicationHome(Main.class);
    logger.info("Exomiser home: {}", home.getDir());
    return home.getDir().toPath();
}