Search in sources :

Example 1 with ApplicationTemp

use of org.springframework.boot.system.ApplicationTemp in project spring-boot by spring-projects.

the class SessionStoreDirectory method getValidDirectory.

File getValidDirectory(boolean mkdirs) {
    File dir = getDirectory();
    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();
    }
    assertDirectory(mkdirs, dir);
    return dir;
}
Also used : ApplicationHome(org.springframework.boot.system.ApplicationHome) File(java.io.File) ApplicationTemp(org.springframework.boot.system.ApplicationTemp)

Example 2 with ApplicationTemp

use of org.springframework.boot.system.ApplicationTemp in project spring-boot by spring-projects.

the class AbstractServletWebServerFactoryTests method getValidSessionStoreWhenSessionStoreNotSet.

@Test
void getValidSessionStoreWhenSessionStoreNotSet() {
    AbstractServletWebServerFactory factory = getFactory();
    File dir = factory.getValidSessionStoreDir(false);
    assertThat(dir.getName()).isEqualTo("servlet-sessions");
    assertThat(dir.getParentFile()).isEqualTo(new ApplicationTemp().getDir());
}
Also used : File(java.io.File) ApplicationTemp(org.springframework.boot.system.ApplicationTemp) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Test(org.junit.jupiter.api.Test)

Aggregations

File (java.io.File)2 ApplicationTemp (org.springframework.boot.system.ApplicationTemp)2 Test (org.junit.jupiter.api.Test)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 ApplicationHome (org.springframework.boot.system.ApplicationHome)1