Package org.pentaho.di.www
Class RegisterPackageServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.pentaho.di.www.BaseHttpServlet
org.pentaho.di.www.BodyHttpServlet
org.pentaho.di.www.BaseJobServlet
org.pentaho.di.www.RegisterPackageServlet
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig,CartePluginInterface,CarteServletInterface
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.pentaho.di.www.BaseHttpServlet
detections, jobMap, log, socketRepository, transformationMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringCombine the two paths with with a separator such as:basePath+ / +relativePath.protected voidcopyAndClose(InputStream inputStream, OutputStream outputStream) Copy contents frominputStreamover tooutputStreamand closeoutputStream.protected StringcopyRequestToDirectory(InputStream inputStream, String directory) Copy contents ofinputStreamtodirectory.protected StringcopyRequestToDirectory(javax.servlet.http.HttpServletRequest request, String directory) Copy file specified inrequesttodirectory.protected StringCreate temporary directory with unique random folder at base.protected StringcreateTempDirString(String baseDirectory) Create temporary directory with unique random folder at base.protected StringcreateTempDirString(String baseDirectory, String folderName) Create temporary directory with unique random folder at base.protected voiddeleteArchive(String file) Remove file.protected StringDecompress zip file.protected voidDecompress zip file.protected NodegetConfigNode(String archiveUrl, String fileName, String xmlTag) Retrieve config xml,xmlTagfrom combined path ofarchiveUrlandfileName.protected StringgetStartFileUrl(String archiveUrl, String requestLoad) Determine the start file url for the ktr/kjb.protected static ZipServiceprotected booleanDetermines ifparameterTypeValueis kettle job.protected booleanisJob(javax.servlet.http.HttpServletRequest request) Determines ifrequestis kettle job.voidsetup(TransformationMap transformationMap, JobMap jobMap, SocketRepository socketRepository, List<SlaveServerDetection> detections) protected static voidsetZipService(ZipService aZipService) protected booleanuseXML(javax.servlet.http.HttpServletRequest request) Methods inherited from class org.pentaho.di.www.BaseJobServlet
createJob, createTransMethods inherited from class org.pentaho.di.www.BodyHttpServlet
beginHtml, doGet, endHtml, getService, startXmlMethods inherited from class org.pentaho.di.www.BaseHttpServlet
convertContextPath, doDelete, doPost, doPut, getDetections, getJobMap, getSocketRepository, getTransformationMap, isJettyMode, logBasic, logBasic, logDebug, logDetailed, logDetailed, logError, logError, logError, logMinimal, logRowlevel, setJettyModeMethods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, doTrace, getLastModified, service, serviceMethods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, logMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pentaho.di.www.CartePluginInterface
isJettyMode, setJettyMode
-
Field Details
-
CONTEXT_PATH
- See Also:
-
PARAMETER_LOAD
- See Also:
-
PARAMETER_TYPE
- See Also:
-
TYPE_JOB
- See Also:
-
TYPE_TRANS
- See Also:
-
-
Constructor Details
-
RegisterPackageServlet
public RegisterPackageServlet()
-
-
Method Details
-
setup
public void setup(TransformationMap transformationMap, JobMap jobMap, SocketRepository socketRepository, List<SlaveServerDetection> detections) - Specified by:
setupin interfaceCartePluginInterface- Overrides:
setupin classBaseHttpServlet
-
getContextPath
-
isJob
protected boolean isJob(javax.servlet.http.HttpServletRequest request) Determines ifrequestis kettle job.- Parameters:
request- http request with parameters.- Returns:
- true if a job, false otherwise.
-
isJob
Determines ifparameterTypeValueis kettle job.- Parameters:
parameterTypeValue- http parameter type value- Returns:
-
useXML
protected boolean useXML(javax.servlet.http.HttpServletRequest request) - Overrides:
useXMLin classBodyHttpServlet
-
getStartFileUrl
Determine the start file url for the ktr/kjb.- Parameters:
archiveUrl-requestLoad-- Returns:
- file path.
-
concat
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,xmlTagfrom combined path ofarchiveUrlandfileName.- Parameters:
archiveUrl- root file path.fileName- xml configuration file at root ofarchiveUrl.xmlTag- xml root tag.- Returns:
- configuration node.
- Throws:
org.pentaho.di.core.exception.KettleXMLException
-
createTempDirString
Create temporary directory with unique random folder at base.- Returns:
- unique temporary directory path.
-
createTempDirString
Create temporary directory with unique random folder at base.- Parameters:
baseDirectory- base file path directory.- Returns:
- unique temporary directory path.
-
createTempDirString
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 inrequesttodirectory.- 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 ofinputStreamtodirectory. 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
Copy contents frominputStreamover tooutputStreamand closeoutputStream.- Parameters:
inputStream-outputStream-- Throws:
IOException
-
extract
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
Remove file.- Parameters:
file- path to file.
-
setZipService
-
getZipService
-