Kaydet (Commit) bc10af10 authored tarafından Bertram Nolte's avatar Bertram Nolte

#101518# Improved working directory.

üst 22328a4f
...@@ -38,7 +38,7 @@ public class ConverterServlet extends HttpServlet { ...@@ -38,7 +38,7 @@ public class ConverterServlet extends HttpServlet {
/** Specifies the temporary directory on the web server. /** Specifies the temporary directory on the web server.
*/ */
private String stringWorkingDirectory = private String stringWorkingDirectory =
System.getProperty( "java.io.tmpdir" ).replace( '\\', '/' ) + "/"; System.getProperty( "java.io.tmpdir" ).replace( '\\', '/' );
/** Specifies the host for the office server. /** Specifies the host for the office server.
*/ */
...@@ -46,7 +46,7 @@ public class ConverterServlet extends HttpServlet { ...@@ -46,7 +46,7 @@ public class ConverterServlet extends HttpServlet {
/** Specifies the port for the office server. /** Specifies the port for the office server.
*/ */
private String stringPort = "8200"; private String stringPort = "8100";
/** Called by the server (via the service method) to allow a servlet to handle /** Called by the server (via the service method) to allow a servlet to handle
* a POST request. The file from the client will be uploaded to the web server * a POST request. The file from the client will be uploaded to the web server
...@@ -59,6 +59,11 @@ public class ConverterServlet extends HttpServlet { ...@@ -59,6 +59,11 @@ public class ConverterServlet extends HttpServlet {
protected void doPost( HttpServletRequest request, protected void doPost( HttpServletRequest request,
HttpServletResponse response) throws ServletException, java.io.IOException { HttpServletResponse response) throws ServletException, java.io.IOException {
try { try {
// If necessary, add a slash to the end of the string.
if ( !stringWorkingDirectory.endsWith( "/" ) ) {
stringWorkingDirectory += "/";
}
// Construct a MultipartRequest to help read the information. // Construct a MultipartRequest to help read the information.
// Pass in the request, a directory to save files to, and the // Pass in the request, a directory to save files to, and the
// maximum POST size we should attempt to handle. // maximum POST size we should attempt to handle.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment