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 String
static final String
static final String
static final String
static final String
Fields inherited from class org.pentaho.di.www.BaseHttpServlet
detections, jobMap, log, socketRepository, transformationMap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Combine the two paths with with a separator such as:basePath
+ / +relativePath
.protected void
copyAndClose
(InputStream inputStream, OutputStream outputStream) Copy contents frominputStream
over tooutputStream
and closeoutputStream
.protected String
copyRequestToDirectory
(InputStream inputStream, String directory) Copy contents ofinputStream
todirectory
.protected String
copyRequestToDirectory
(javax.servlet.http.HttpServletRequest request, String directory) Copy file specified inrequest
todirectory
.protected String
Create temporary directory with unique random folder at base.protected String
createTempDirString
(String baseDirectory) Create temporary directory with unique random folder at base.protected String
createTempDirString
(String baseDirectory, String folderName) Create temporary directory with unique random folder at base.protected void
deleteArchive
(String file) Remove file.protected String
Decompress zip file.protected void
Decompress zip file.protected Node
getConfigNode
(String archiveUrl, String fileName, String xmlTag) Retrieve config xml,xmlTag
from combined path ofarchiveUrl
andfileName
.protected String
getStartFileUrl
(String archiveUrl, String requestLoad) Determine the start file url for the ktr/kjb.protected static ZipService
protected boolean
Determines ifparameterTypeValue
is kettle job.protected boolean
isJob
(javax.servlet.http.HttpServletRequest request) Determines ifrequest
is kettle job.void
setup
(TransformationMap transformationMap, JobMap jobMap, SocketRepository socketRepository, List<SlaveServerDetection> detections) protected static void
setZipService
(ZipService aZipService) protected boolean
useXML
(javax.servlet.http.HttpServletRequest request) Methods inherited from class org.pentaho.di.www.BaseJobServlet
createJob, createTrans
Methods inherited from class org.pentaho.di.www.BodyHttpServlet
beginHtml, doGet, endHtml, getService, startXml
Methods 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, setJettyMode
Methods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, 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
Methods 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:
setup
in interfaceCartePluginInterface
- Overrides:
setup
in classBaseHttpServlet
-
getContextPath
-
isJob
protected boolean isJob(javax.servlet.http.HttpServletRequest request) Determines ifrequest
is kettle job.- Parameters:
request
- http request with parameters.- Returns:
- true if a job, false otherwise.
-
isJob
Determines ifparameterTypeValue
is kettle job.- Parameters:
parameterTypeValue
- http parameter type value- Returns:
-
useXML
protected boolean useXML(javax.servlet.http.HttpServletRequest request) - Overrides:
useXML
in 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,xmlTag
from combined path ofarchiveUrl
andfileName
.- 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 inrequest
todirectory
.- 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 ofinputStream
todirectory
. 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 frominputStream
over tooutputStream
and 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
-