File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
extension/fileupload/src/main/java/cloud/piranha/extension/fileupload Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 44
44
* </p>
45
45
*
46
46
* <ol>
47
- * <li>Sets the MultiPartManager to an instance of FileUploadMultiPartManager.</li>
48
- * <li>Adds the JakartaFileCleaner listener that cleans up the temporary files.</li>
47
+ * <li>Sets the MultiPartManager to an instance of
48
+ * FileUploadMultiPartManager.</li>
49
+ * <li>Adds the JakartaFileCleaner listener that cleans up the temporary
50
+ * files.</li>
49
51
* </ol>
50
52
*
51
53
* @author Manfred Riem (mriem@manorrock.com)
@@ -62,13 +64,17 @@ public class FileUploadMultiPartInitializer implements ServletContainerInitializ
62
64
*/
63
65
public FileUploadMultiPartInitializer () {
64
66
}
65
-
67
+
66
68
@ Override
67
69
public void onStartup (Set <Class <?>> classes , ServletContext servletContext ) throws ServletException {
68
70
WebApplication webApplication = (WebApplication ) servletContext ;
69
- LOGGER .log (TRACE , "Setting the MultiPartManager" );
71
+ if (LOGGER .isLoggable (TRACE )) {
72
+ LOGGER .log (TRACE , "Setting the MultiPartManager" );
73
+ }
70
74
webApplication .getManager ().setMultiPartManager (new FileUploadMultiPartManager ());
71
- LOGGER .log (TRACE , "Adding the listener used to cleanup temporary files" );
75
+ if (LOGGER .isLoggable (TRACE )) {
76
+ LOGGER .log (TRACE , "Adding the listener used to cleanup temporary files" );
77
+ }
72
78
webApplication .addListener ("org.apache.commons.fileupload2.jakarta.servlet6.JakartaFileCleaner" );
73
79
}
74
80
}
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ private synchronized JakartaServletFileUpload setupFileUpload(WebApplication web
156
156
* If the multipart config has a location use it. If it is relative
157
157
* use the TEMPDIR as the parent directory.
158
158
*/
159
- if (multipartConfig .getLocation () != null && multipartConfig .getLocation ().isEmpty ()) {
159
+ if (multipartConfig .getLocation () != null && ! multipartConfig .getLocation ().isEmpty ()) {
160
160
File location = new File (multipartConfig .getLocation ());
161
161
if (!location .isAbsolute ()) {
162
162
location = ((File ) webApplication .getAttribute (TEMPDIR )).toPath ().resolve (location .toPath ()).toFile ();
You can’t perform that action at this time.
0 commit comments