Package com.oreilly.servlet

Examples of com.oreilly.servlet.MultipartResponse


                    // Set the filename, is used when the file will be saved (problem with mozilla)
                    response.addHeader( "Content-Disposition",
                                        "attachment; filename=" + shortFileName);
               
                    // Constructing the multi part response to the client
                    MultipartResponse multipartresponse = new MultipartResponse(response);
               
                    // Is the convert type HTML?
                    if ( ( multipartrequest.getParameter( "converttype" ).equals(
                               "swriter: HTML (StarWriter)" ) )
                         || ( multipartrequest.getParameter( "converttype" ).equals(
                                  "scalc: HTML (StarCalc)" ) ) ) {
                        // Setting the content type of the response being sent to the client
                        // to text
                        multipartresponse.startResponse( "text/html" );
                    } else {
                        // Setting the content type of the response being sent to the client
                        // to application/octet-stream so that file will open a dialog box
                        // at the client in order to save the converted file
                        multipartresponse.startResponse( "application/octet-stream" );
                    }
                   
                    // Pushing the converted file to the client
                    ServletUtils.returnFile( stringConvertedFile,
                                             response.getOutputStream() );
                   
                    // Finishing the multi part response
                    multipartresponse.finish();
                   
                    // clean up the working directory
                    cleanupFile = new File(stringConvertedFile);
                    if ( cleanupFile.exists() )
                        cleanupFile.delete();
View Full Code Here


        stringWorkingDirectory + stringFilename,
        multipartrequest.getParameter( "converttype" ),
        multipartrequest.getParameter( "extension" ) );

        // Constructing the multi part response to the client
        MultipartResponse multipartresponse = new MultipartResponse(
        response );
       
        // Is the convert type HTML?
        if ( ( multipartrequest.getParameter( "converttype" ).equals(
        "swriter: HTML (StarWriter)" ) )
        || ( multipartrequest.getParameter( "converttype" ).equals(
        "scalc: HTML (StarCalc)" ) ) ) {
          // Setting the content type of the response being sent to the client
          // to text
          multipartresponse.startResponse( "text/html" );
        } else {
          // Setting the content type of the response being sent to the client
          // to application/octet-stream so that file will open a dialog box
          // at the client in order to save the converted file
          multipartresponse.startResponse( "application/octet-stream" );
        }
       
        // Pushing the converted file to the client
        ServletUtils.returnFile( stringConvertedFile,
        response.getOutputStream() );

        // Finishing the multi part response
        multipartresponse.finish();
      }
    }
    catch (Exception exception) {
      System.err.println( exception.toString() );
    }
View Full Code Here

                    // Set the filename, is used when the file will be saved (problem with mozilla)
                    response.addHeader( "Content-Disposition",
                                        "attachment; filename=" + shortFileName);
               
                    // Constructing the multi part response to the client
                    MultipartResponse multipartresponse = new MultipartResponse(response);
               
                    // Is the convert type HTML?
                    if ( ( multipartrequest.getParameter( "converttype" ).equals(
                               "swriter: HTML (StarWriter)" ) )
                         || ( multipartrequest.getParameter( "converttype" ).equals(
                                  "scalc: HTML (StarCalc)" ) ) ) {
                        // Setting the content type of the response being sent to the client
                        // to text
                        multipartresponse.startResponse( "text/html" );
                    } else {
                        // Setting the content type of the response being sent to the client
                        // to application/octet-stream so that file will open a dialog box
                        // at the client in order to save the converted file
                        multipartresponse.startResponse( "application/octet-stream" );
                    }
                   
                    // Pushing the converted file to the client
                    ServletUtils.returnFile( stringConvertedFile,
                                             response.getOutputStream() );
                   
                    // Finishing the multi part response
                    multipartresponse.finish();
                   
                    // clean up the working directory
                    cleanupFile = new File(stringConvertedFile);
                    if ( cleanupFile.exists() )
                        cleanupFile.delete();
View Full Code Here

                    // Set the filename, is used when the file will be saved (problem with mozilla)
                    response.addHeader( "Content-Disposition",
                                        "attachment; filename=" + shortFileName);
               
                    // Constructing the multi part response to the client
                    MultipartResponse multipartresponse = new MultipartResponse(response);
               
                    // Is the convert type HTML?
                    if ( ( multipartrequest.getParameter( "converttype" ).equals(
                               "swriter: HTML (StarWriter)" ) )
                         || ( multipartrequest.getParameter( "converttype" ).equals(
                                  "scalc: HTML (StarCalc)" ) ) ) {
                        // Setting the content type of the response being sent to the client
                        // to text
                        multipartresponse.startResponse( "text/html" );
                    } else {
                        // Setting the content type of the response being sent to the client
                        // to application/octet-stream so that file will open a dialog box
                        // at the client in order to save the converted file
                        multipartresponse.startResponse( "application/octet-stream" );
                    }
                   
                    // Pushing the converted file to the client
                    ServletUtils.returnFile( stringConvertedFile,
                                             response.getOutputStream() );
                   
                    // Finishing the multi part response
                    multipartresponse.finish();
                   
                    // clean up the working directory
                    cleanupFile = new File(stringConvertedFile);
                    if ( cleanupFile.exists() )
                        cleanupFile.delete();
View Full Code Here

        stringWorkingDirectory + stringFilename,
        multipartrequest.getParameter( "converttype" ),
        multipartrequest.getParameter( "extension" ) );

        // Constructing the multi part response to the client
        MultipartResponse multipartresponse = new MultipartResponse(
        response );
       
        // Is the convert type HTML?
        if ( ( multipartrequest.getParameter( "converttype" ).equals(
        "swriter: HTML (StarWriter)" ) )
        || ( multipartrequest.getParameter( "converttype" ).equals(
        "scalc: HTML (StarCalc)" ) ) ) {
          // Setting the content type of the response being sent to the client
          // to text
          multipartresponse.startResponse( "text/html" );
        } else {
          // Setting the content type of the response being sent to the client
          // to application/octet-stream so that file will open a dialog box
          // at the client in order to save the converted file
          multipartresponse.startResponse( "application/octet-stream" );
        }
       
        // Pushing the converted file to the client
        ServletUtils.returnFile( stringConvertedFile,
        response.getOutputStream() );

        // Finishing the multi part response
        multipartresponse.finish();
      }
    }
    catch (Exception exception) {
      System.err.println( exception.toString() );
    }
View Full Code Here

                    // Set the filename, is used when the file will be saved (problem with mozilla)
                    response.addHeader( "Content-Disposition",
                                        "attachment; filename=" + shortFileName);
               
                    // Constructing the multi part response to the client
                    MultipartResponse multipartresponse = new MultipartResponse(response);
               
                    // Is the convert type HTML?
                    if ( ( multipartrequest.getParameter( "converttype" ).equals(
                               "swriter: HTML (StarWriter)" ) )
                         || ( multipartrequest.getParameter( "converttype" ).equals(
                                  "scalc: HTML (StarCalc)" ) ) ) {
                        // Setting the content type of the response being sent to the client
                        // to text
                        multipartresponse.startResponse( "text/html" );
                    } else {
                        // Setting the content type of the response being sent to the client
                        // to application/octet-stream so that file will open a dialog box
                        // at the client in order to save the converted file
                        multipartresponse.startResponse( "application/octet-stream" );
                    }
                   
                    // Pushing the converted file to the client
                    ServletUtils.returnFile( stringConvertedFile,
                                             response.getOutputStream() );
                   
                    // Finishing the multi part response
                    multipartresponse.finish();
                   
                    // clean up the working directory
                    cleanupFile = new File(stringConvertedFile);
                    if ( cleanupFile.exists() )
                        cleanupFile.delete();
View Full Code Here

        stringWorkingDirectory + stringFilename,
        multipartrequest.getParameter( "converttype" ),
        multipartrequest.getParameter( "extension" ) );

        // Constructing the multi part response to the client
        MultipartResponse multipartresponse = new MultipartResponse(
        response );
       
        // Is the convert type HTML?
        if ( ( multipartrequest.getParameter( "converttype" ).equals(
        "swriter: HTML (StarWriter)" ) )
        || ( multipartrequest.getParameter( "converttype" ).equals(
        "scalc: HTML (StarCalc)" ) ) ) {
          // Setting the content type of the response being sent to the client
          // to text
          multipartresponse.startResponse( "text/html" );
        } else {
          // Setting the content type of the response being sent to the client
          // to application/octet-stream so that file will open a dialog box
          // at the client in order to save the converted file
          multipartresponse.startResponse( "application/octet-stream" );
        }
       
        // Pushing the converted file to the client
        ServletUtils.returnFile( stringConvertedFile,
        response.getOutputStream() );

        // Finishing the multi part response
        multipartresponse.finish();
      }
    }
    catch (Exception exception) {
      System.err.println( exception.toString() );
    }
View Full Code Here

TOP

Related Classes of com.oreilly.servlet.MultipartResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.