MCPcopy Index your code
hub / github.com/apache/tomcat / directory

Method directory

java/org/apache/catalina/session/FileStore.java:308–333  ·  view source on GitHub ↗

Return a File object representing the pathname to our session persistence directory, if any. The directory will be created if it does not already exist.

()

Source from the content-addressed store, hash-verified

306 * be created if it does not already exist.
307 */
308 private synchronized File directory() throws IOException {
309 // Synchronised to avoid concurrent attempts to create the directory.
310 if (this.directory == null) {
311 return null;
312 }
313 if (this.directoryFile != null) {
314 return this.directoryFile;
315 }
316 File file = new File(this.directory);
317 if (!file.isAbsolute()) {
318 Context context = manager.getContext();
319 ServletContext servletContext = context.getServletContext();
320 File work = (File) servletContext.getAttribute(ServletContext.TEMPDIR);
321 file = new File(work, this.directory);
322 }
323 if (!file.exists() || !file.isDirectory()) {
324 if (!file.delete() && file.exists()) {
325 throw new IOException(sm.getString("fileStore.deleteFailed", file));
326 }
327 if (!file.mkdirs() && !file.isDirectory()) {
328 throw new IOException(sm.getString("fileStore.createFailed", file));
329 }
330 }
331 this.directoryFile = file;
332 return file;
333 }
334
335
336 /**

Callers 3

getSizeMethod · 0.95
keysMethod · 0.95
fileMethod · 0.95

Calls 7

getServletContextMethod · 0.95
getAttributeMethod · 0.95
getContextMethod · 0.65
existsMethod · 0.65
isDirectoryMethod · 0.65
deleteMethod · 0.65
getStringMethod · 0.65

Tested by

no test coverage detected