Class RegisterPackageServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, CartePluginInterface, CarteServletInterface

public class RegisterPackageServlet extends BaseJobServlet
See Also:
  • Field Details

  • Constructor Details

    • RegisterPackageServlet

      public RegisterPackageServlet()
  • Method Details

    • setup

      public void setup(TransformationMap transformationMap, JobMap jobMap, SocketRepository socketRepository, List<SlaveServerDetection> detections)
      Specified by:
      setup in interface CartePluginInterface
      Overrides:
      setup in class BaseHttpServlet
    • getContextPath

      public String getContextPath()
    • isJob

      protected boolean isJob(javax.servlet.http.HttpServletRequest request)
      Determines if request is kettle job.
      Parameters:
      request - http request with parameters.
      Returns:
      true if a job, false otherwise.
    • isJob

      protected boolean isJob(String parameterTypeValue)
      Determines if parameterTypeValue is kettle job.
      Parameters:
      parameterTypeValue - http parameter type value
      Returns:
    • useXML

      protected boolean useXML(javax.servlet.http.HttpServletRequest request)
      Overrides:
      useXML in class BodyHttpServlet
    • getStartFileUrl

      protected String getStartFileUrl(String archiveUrl, String requestLoad)
      Determine the start file url for the ktr/kjb.
      Parameters:
      archiveUrl -
      requestLoad -
      Returns:
      file path.
    • concat

      protected String concat(String basePath, String relativePath)
      Combine the two paths with with a separator such as: basePath + / + relativePath.
      Parameters:
      basePath - full path to root of directory.
      relativePath - a non-absolute path.
      Returns:
      combined file path.
    • getConfigNode

      protected Node getConfigNode(String archiveUrl, String fileName, String xmlTag) throws org.pentaho.di.core.exception.KettleXMLException
      Retrieve config xml, xmlTag from combined path of archiveUrl and fileName.
      Parameters:
      archiveUrl - root file path.
      fileName - xml configuration file at root of archiveUrl.
      xmlTag - xml root tag.
      Returns:
      configuration node.
      Throws:
      org.pentaho.di.core.exception.KettleXMLException
    • createTempDirString

      protected String createTempDirString()
      Create temporary directory with unique random folder at base.
      Returns:
      unique temporary directory path.
    • createTempDirString

      protected String createTempDirString(String baseDirectory)
      Create temporary directory with unique random folder at base.
      Parameters:
      baseDirectory - base file path directory.
      Returns:
      unique temporary directory path.
    • createTempDirString

      protected String createTempDirString(String baseDirectory, String folderName)
      Create temporary directory with unique random folder at base.

      Format : baseDirectory + / + folderName

      Parameters:
      baseDirectory - base file path directory.
      folderName -
      Returns:
      unique temporary directory path.
    • copyRequestToDirectory

      protected String copyRequestToDirectory(javax.servlet.http.HttpServletRequest request, String directory) throws org.pentaho.di.core.exception.KettleException
      Copy file specified in request to directory.
      Parameters:
      request - http request with payload.
      directory - local destination directory.
      Returns:
      copied file path.
      Throws:
      org.pentaho.di.core.exception.KettleException
    • copyRequestToDirectory

      protected String copyRequestToDirectory(InputStream inputStream, String directory) throws org.pentaho.di.core.exception.KettleException
      Copy contents of inputStream to directory. Expecting zip file.
      Parameters:
      inputStream - zip file input stream.
      directory - local destination directory.
      Returns:
      copied file path.
      Throws:
      org.pentaho.di.core.exception.KettleException
    • copyAndClose

      protected void copyAndClose(InputStream inputStream, OutputStream outputStream) throws IOException
      Copy contents from inputStream over to outputStream and close outputStream.
      Parameters:
      inputStream -
      outputStream -
      Throws:
      IOException
    • extract

      protected String extract(String zipFilePath) throws org.pentaho.di.core.exception.KettleException
      Decompress zip file.
      Parameters:
      zipFilePath - zip file path.
      Returns:
      returns path to new directory containing files.
      Throws:
      org.pentaho.di.core.exception.KettleException
    • extract

      protected void extract(String zipFilePath, String destinationDirectory) throws org.pentaho.di.core.exception.KettleException
      Decompress zip file.
      Parameters:
      zipFilePath - zip file.
      destinationDirectory - destination directory.
      Throws:
      org.pentaho.di.core.exception.KettleException
    • deleteArchive

      protected void deleteArchive(String file)
      Remove file.
      Parameters:
      file - path to file.
    • setZipService

      protected static void setZipService(ZipService aZipService)
    • getZipService

      protected static ZipService getZipService()