pl.psnc.dl.ege.webapp.servlet
Class ConversionServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by pl.psnc.dl.ege.webapp.servlet.ConversionServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ConversionServlet
extends javax.servlet.http.HttpServlet

EGE RESTful WebService interface. Conversion web service servlet, accepting requests in REST WS manner.

Author:
mariuszs
See Also:
Serialized Form

Field Summary
static java.lang.String COMMA
           
static java.lang.String CONVERSIONS_SLICE_BASE
           
static java.lang.String DOCX_EXT
           
static java.lang.String R_WRONG_METHOD
           
static java.lang.String SEMICOLON
           
static java.lang.String SLASH
           
static java.lang.String ZIP_EXT
           
 
Constructor Summary
ConversionServlet()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Serves GET requests - responses are : list of input data types and lists of possible conversions paths.
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Servers POST method - performs conversions over specified within URL conversions path.
 LabelProvider getLabelProvider()
          Returns local names provider.
 MimeExtensionProvider getMimeExtensionProvider()
          Returns map that contains mapping of mime type to file extension.
protected  void performConversion(javax.servlet.http.HttpServletResponse response, ConversionRequestResolver rr, java.util.List<DataType> pathFrame)
           
protected  void printConversionPossibilities(javax.servlet.http.HttpServletResponse response, RequestResolver rr, java.util.Set<DataType> inputDataTypes)
           
protected  void printConversionsPaths(javax.servlet.http.HttpServletResponse response, RequestResolver rr, java.util.List<ConversionsPath> paths)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SLASH

public static final java.lang.String SLASH
See Also:
Constant Field Values

COMMA

public static final java.lang.String COMMA
See Also:
Constant Field Values

SEMICOLON

public static final java.lang.String SEMICOLON
See Also:
Constant Field Values

R_WRONG_METHOD

public static final java.lang.String R_WRONG_METHOD
See Also:
Constant Field Values

CONVERSIONS_SLICE_BASE

public static final java.lang.String CONVERSIONS_SLICE_BASE
See Also:
Constant Field Values

ZIP_EXT

public static final java.lang.String ZIP_EXT
See Also:
Constant Field Values

DOCX_EXT

public static final java.lang.String DOCX_EXT
See Also:
Constant Field Values
Constructor Detail

ConversionServlet

public ConversionServlet()
See Also:
HttpServlet.HttpServlet()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Serves GET requests - responses are : list of input data types and lists of possible conversions paths.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

printConversionsPaths

protected void printConversionsPaths(javax.servlet.http.HttpServletResponse response,
                                     RequestResolver rr,
                                     java.util.List<ConversionsPath> paths)
                              throws java.io.IOException
Throws:
java.io.IOException

printConversionPossibilities

protected void printConversionPossibilities(javax.servlet.http.HttpServletResponse response,
                                            RequestResolver rr,
                                            java.util.Set<DataType> inputDataTypes)
                                     throws java.io.IOException
Throws:
java.io.IOException

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Servers POST method - performs conversions over specified within URL conversions path.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

performConversion

protected void performConversion(javax.servlet.http.HttpServletResponse response,
                                 ConversionRequestResolver rr,
                                 java.util.List<DataType> pathFrame)
                          throws java.io.IOException,
                                 org.apache.commons.fileupload.FileUploadException,
                                 EGEException,
                                 ConverterException,
                                 RequestResolvingException
Throws:
java.io.IOException
org.apache.commons.fileupload.FileUploadException
EGEException
ConverterException
RequestResolvingException

getLabelProvider

public LabelProvider getLabelProvider()
Returns local names provider.

Returns:

getMimeExtensionProvider

public MimeExtensionProvider getMimeExtensionProvider()
Returns map that contains mapping of mime type to file extension.

Returns:


Copyright © 2010. All Rights Reserved.