Polish
This commit resolves typos and naming inconsistency. Closes gh-4455
This commit is contained in:
parent
b27d66fedd
commit
e5b31beb68
|
|
@ -95,7 +95,7 @@ public class ApplicationHome {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the underlying source used to find the home folder. This is usually the jar
|
||||
* Returns the underlying source used to find the home directory. This is usually the jar
|
||||
* file or a directory. Can return {@code null} if the source cannot be determined.
|
||||
* @return the underlying source or {@code null}
|
||||
*/
|
||||
|
|
@ -104,8 +104,8 @@ public class ApplicationHome {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the application home folder.
|
||||
* @return the home folder (never {@code null})
|
||||
* Returns the application home directory.
|
||||
* @return the home directory (never {@code null})
|
||||
*/
|
||||
public File getDir() {
|
||||
return this.dir;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import org.springframework.core.env.Environment;
|
|||
|
||||
/**
|
||||
* Simple detection for well known cloud platforms. For more advanced cloud provider
|
||||
* integration consider the Spring Clould project.
|
||||
* integration consider the Spring Cloud project.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @since 1.3.0
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ public abstract class AbstractConfigurableEmbeddedServletContainer
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not he JSP servlet should be registered with the embedded
|
||||
* Returns whether or not the JSP servlet should be registered with the embedded
|
||||
* container.
|
||||
* @return {@code true} if the container should be registered, otherwise {@code false}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public abstract class AbstractEmbeddedServletContainerFactory
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the absolute document root when it points to a valid folder, logging a
|
||||
* Returns the absolute document root when it points to a valid directory, logging a
|
||||
* warning and returning {@code null} otherwise.
|
||||
* @return the valid document root
|
||||
*/
|
||||
|
|
@ -171,15 +171,15 @@ public abstract class AbstractEmbeddedServletContainerFactory
|
|||
*/
|
||||
protected File createTempDir(String prefix) {
|
||||
try {
|
||||
File tempFolder = File.createTempFile(prefix + ".", "." + getPort());
|
||||
tempFolder.delete();
|
||||
tempFolder.mkdir();
|
||||
tempFolder.deleteOnExit();
|
||||
return tempFolder;
|
||||
File tempDir = File.createTempFile(prefix + ".", "." + getPort());
|
||||
tempDir.delete();
|
||||
tempDir.mkdir();
|
||||
tempDir.deleteOnExit();
|
||||
return tempDir;
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new EmbeddedServletContainerException(
|
||||
"Unable to create tempdir. java.io.tmpdir is set to "
|
||||
"Unable to create tempDir. java.io.tmpdir is set to "
|
||||
+ System.getProperty("java.io.tmpdir"),
|
||||
ex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ public interface ConfigurableEmbeddedServletContainer {
|
|||
void setMimeMappings(MimeMappings mimeMappings);
|
||||
|
||||
/**
|
||||
* Sets the document root folder which will be used by the web context to serve static
|
||||
* Sets the document root directory which will be used by the web context to serve static
|
||||
* files.
|
||||
* @param documentRoot the document root or {@code null} if not required
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -411,8 +411,8 @@ public class TomcatEmbeddedServletContainerFactory
|
|||
Assert.state(manager instanceof StandardManager,
|
||||
"Unable to persist HTTP session state using manager type "
|
||||
+ manager.getClass().getName());
|
||||
File folder = getValidSessionStoreDir();
|
||||
File file = new File(folder, "SESSIONS.ser");
|
||||
File dir = getValidSessionStoreDir();
|
||||
File file = new File(dir, "SESSIONS.ser");
|
||||
((StandardManager) manager).setPathname(file.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ abstract class TomcatResources {
|
|||
|
||||
@Override
|
||||
protected void addJar(String jar) {
|
||||
URL url = getJarUlr(jar);
|
||||
URL url = getJarUrl(jar);
|
||||
if (url != null) {
|
||||
try {
|
||||
this.addResourceJarUrlMethod.invoke(getContext(), url);
|
||||
|
|
@ -127,7 +127,7 @@ abstract class TomcatResources {
|
|||
}
|
||||
}
|
||||
|
||||
private URL getJarUlr(String jar) {
|
||||
private URL getJarUrl(String jar) {
|
||||
try {
|
||||
return new URL(jar);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ import io.undertow.servlet.api.SessionPersistenceManager;
|
|||
*/
|
||||
public class FileSessionPersistence implements SessionPersistenceManager {
|
||||
|
||||
private final File folder;
|
||||
private final File dir;
|
||||
|
||||
public FileSessionPersistence(File folder) {
|
||||
this.folder = folder;
|
||||
public FileSessionPersistence(File dir) {
|
||||
this.dir = dir;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -124,10 +124,10 @@ public class FileSessionPersistence implements SessionPersistenceManager {
|
|||
}
|
||||
|
||||
private File getSessionFile(String deploymentName) {
|
||||
if (!this.folder.exists()) {
|
||||
this.folder.mkdirs();
|
||||
if (!this.dir.exists()) {
|
||||
this.dir.mkdirs();
|
||||
}
|
||||
return new File(this.folder, deploymentName + ".session");
|
||||
return new File(this.dir, deploymentName + ".session");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public class UndertowEmbeddedServletContainer implements EmbeddedServletContaine
|
|||
}
|
||||
catch (ServletException ex) {
|
||||
throw new EmbeddedServletContainerException(
|
||||
"Unable to start embdedded Undertow", ex);
|
||||
"Unable to start embedded Undertow", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -358,8 +358,8 @@ public class UndertowEmbeddedServletContainerFactory
|
|||
configureAccessLog(deployment);
|
||||
}
|
||||
if (isPersistSession()) {
|
||||
File folder = getValidSessionStoreDir();
|
||||
deployment.setSessionPersistenceManager(new FileSessionPersistence(folder));
|
||||
File dir = getValidSessionStoreDir();
|
||||
deployment.setSessionPersistenceManager(new FileSessionPersistence(dir));
|
||||
}
|
||||
DeploymentManager manager = Servlets.defaultContainer().addDeployment(deployment);
|
||||
manager.deploy();
|
||||
|
|
@ -433,7 +433,7 @@ public class UndertowEmbeddedServletContainerFactory
|
|||
return new FileResourceManager(root, 0);
|
||||
}
|
||||
if (root.isFile()) {
|
||||
return new JarResourcemanager(root);
|
||||
return new JarResourceManager(root);
|
||||
}
|
||||
return ResourceManager.EMPTY_RESOURCE_MANAGER;
|
||||
}
|
||||
|
|
@ -532,15 +532,15 @@ public class UndertowEmbeddedServletContainerFactory
|
|||
/**
|
||||
* Undertow {@link ResourceManager} for JAR resources.
|
||||
*/
|
||||
private static class JarResourcemanager implements ResourceManager {
|
||||
private static class JarResourceManager implements ResourceManager {
|
||||
|
||||
private final String jarPath;
|
||||
|
||||
JarResourcemanager(File jarFile) {
|
||||
JarResourceManager(File jarFile) {
|
||||
this(jarFile.getAbsolutePath());
|
||||
}
|
||||
|
||||
JarResourcemanager(String jarPath) {
|
||||
JarResourceManager(String jarPath) {
|
||||
this.jarPath = jarPath;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.springframework.mock.web.MockServletContext;
|
|||
|
||||
/**
|
||||
* {@link MockServletContext} implementation for Spring Boot. Respects well know Spring
|
||||
* Boot resource locations and uses an empty folder for "/" if no locations can be found.
|
||||
* Boot resource locations and uses an empty directory for "/" if no locations can be found.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
|
|
@ -88,7 +88,7 @@ public class SpringBootMockServletContext extends MockServletContext {
|
|||
public URL getResource(String path) throws MalformedURLException {
|
||||
URL resource = super.getResource(path);
|
||||
if (resource == null && "/".equals(path)) {
|
||||
// Liquibase assumes that "/" always exists, if we don't have a folder
|
||||
// Liquibase assumes that "/" always exists, if we don't have a directory
|
||||
// use a temporary location.
|
||||
try {
|
||||
if (this.emptyRootFolder == null) {
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ public class TomcatEmbeddedServletContainerFactoryTests
|
|||
public void disableDoesNotSaveSessionFiles() throws Exception {
|
||||
File baseDir = this.temporaryFolder.newFolder();
|
||||
TomcatEmbeddedServletContainerFactory factory = getFactory();
|
||||
// If baseDir is not set SESSIONS.ser is written to a different temp folder
|
||||
// If baseDir is not set SESSIONS.ser is written to a different temp directory
|
||||
// each time. By setting it we can really ensure that data isn't saved
|
||||
factory.setBaseDirectory(baseDir);
|
||||
this.container = factory
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class FileSessionPersistenceTests {
|
|||
@Rule
|
||||
public TemporaryFolder temp = new TemporaryFolder();
|
||||
|
||||
private File folder;
|
||||
private File dir;
|
||||
|
||||
private FileSessionPersistence persistence;
|
||||
|
||||
|
|
@ -53,8 +53,8 @@ public class FileSessionPersistenceTests {
|
|||
|
||||
@Before
|
||||
public void setup() throws IOException {
|
||||
this.folder = this.temp.newFolder();
|
||||
this.persistence = new FileSessionPersistence(this.folder);
|
||||
this.dir = this.temp.newFolder();
|
||||
this.persistence = new FileSessionPersistence(this.dir);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -97,7 +97,7 @@ public class FileSessionPersistenceTests {
|
|||
|
||||
@Test
|
||||
public void deleteFileOnClear() throws Exception {
|
||||
File sessionFile = new File(this.folder, "test.session");
|
||||
File sessionFile = new File(this.dir, "test.session");
|
||||
Map<String, PersistentSession> sessionData = new LinkedHashMap<String, PersistentSession>();
|
||||
this.persistence.persistSessions("test", sessionData);
|
||||
assertThat(sessionFile.exists(), equalTo(true));
|
||||
|
|
|
|||
Loading…
Reference in New Issue