Skip to content

Commit

Permalink
[BACKLOG-38777] FTPS get and update Core To Plugin Movement
Browse files Browse the repository at this point in the history
  • Loading branch information
Mandakini1990 committed Sep 28, 2023
1 parent e4f2b7e commit 6c24b6d
Show file tree
Hide file tree
Showing 43 changed files with 595 additions and 218 deletions.
13 changes: 13 additions & 0 deletions assemblies/plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<pentaho-reporting-plugin.version>10.1.0.0-SNAPSHOT</pentaho-reporting-plugin.version>
<ms-access-plugin.version>${project.version}</ms-access-plugin.version>
<get-file-sftp-plugin.version>${project.version}</get-file-sftp-plugin.version>
<ftps-plugin.version>${project.version}</ftps-plugin.version>
<oracle-bulk-loader-plugin.version>${project.version}</oracle-bulk-loader-plugin.version>
<terafast-bulk-loader-plugin.version>${project.version}</terafast-bulk-loader-plugin.version>
<postgresql-db-bulk-loader-plugin.version>${project.version}</postgresql-db-bulk-loader-plugin.version>
Expand Down Expand Up @@ -130,6 +131,18 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>ftps-plugin</artifactId>
<version>${ftps-plugin.version}</version>
<type>zip</type>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>kettle-shapefilereader-plugin</artifactId>
Expand Down
2 changes: 0 additions & 2 deletions engine/src/main/resources/kettle-job-entries.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<job-entry id="JOB"> <description>i18n:org.pentaho.di.job.entry:JobEntry.Job.TypeDesc</description> <classname>org.pentaho.di.job.entries.job.JobEntryJob</classname> <category>i18n:org.pentaho.di.job:JobCategory.Category.General</category> <tooltip>i18n:org.pentaho.di.job.entry:JobEntry.Job.Tooltip</tooltip> <iconfile>ui/images/JOB.svg</iconfile> <documentation_url>Products/Job_(job_entry)</documentation_url> <cases_url>https://jira.pentaho.com/browse/PDI</cases_url> <forum_url>https://community.hds.com/community/products-and-solutions/pentaho/data-integration</forum_url> </job-entry>
<job-entry id="SHELL"> <description>i18n:org.pentaho.di.job.entry:JobEntry.Shell.TypeDesc</description> <classname>org.pentaho.di.job.entries.shell.JobEntryShell</classname> <category>i18n:org.pentaho.di.job:JobCategory.Category.Scripting</category> <tooltip>i18n:org.pentaho.di.job.entry:JobEntry.Shell.Tooltip</tooltip> <iconfile>ui/images/SHL.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Shell</documentation_url> <cases_url/> <forum_url/> </job-entry>
<job-entry id="SQL"> <description>i18n:org.pentaho.di.job.entry:JobEntry.SQL.TypeDesc</description> <classname>org.pentaho.di.job.entries.sql.JobEntrySQL</classname> <category>i18n:org.pentaho.di.job:JobCategory.Category.Scripting</category> <tooltip>i18n:org.pentaho.di.job.entry:JobEntry.SQL.Tooltip</tooltip> <iconfile>ui/images/SQL.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/SQL</documentation_url> <cases_url/> <forum_url/> </job-entry>
<job-entry id="FTPS_GET"> <description>i18n:org.pentaho.di.job.entry:JobEntry.FTPSGet.TypeDesc</description> <classname>org.pentaho.di.job.entries.ftpsget.JobEntryFTPSGet</classname> <category>i18n:org.pentaho.di.job:JobCategory.Category.FileTransfer</category> <tooltip>i18n:org.pentaho.di.job.entry:JobEntry.FTPSGet.Tooltip</tooltip> <iconfile>ui/images/GFTPS.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Get+a+file+with+FTPS</documentation_url> <cases_url/> <forum_url/> </job-entry>
<job-entry id="FTPS_PUT"> <description>i18n:org.pentaho.di.job.entry:JobEntry.FTPSPut.TypeDesc</description> <classname>org.pentaho.di.job.entries.ftpsput.JobEntryFTPSPUT</classname> <category>i18n:org.pentaho.di.job:JobCategory.Category.FileTransfer</category> <tooltip>i18n:org.pentaho.di.job.entry:JobEntry.FTPSPut.Tooltip</tooltip> <iconfile>ui/images/PFTPS.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Upload+files+to+FTPS</documentation_url> <cases_url/> <forum_url/> </job-entry>
<job-entry id="TABLE_EXISTS"> <description>i18n:org.pentaho.di.job.entry:JobEntry.TableExists.TypeDesc</description> <classname>org.pentaho.di.job.entries.tableexists.JobEntryTableExists</classname> <category>i18n:org.pentaho.di.job:JobCategory.Category.Conditions</category> <tooltip>i18n:org.pentaho.di.job.entry:JobEntry.TableExists.Tooltip</tooltip> <iconfile>ui/images/TEX.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Table+Exists+%28Job+Entry%29</documentation_url> <cases_url/> <forum_url/> </job-entry>
<job-entry id="FILE_EXISTS"> <description>i18n:org.pentaho.di.job.entry:JobEntry.FileExists.TypeDesc</description> <classname>org.pentaho.di.job.entries.fileexists.JobEntryFileExists</classname> <category>i18n:org.pentaho.di.job:JobCategory.Category.Conditions</category> <tooltip>i18n:org.pentaho.di.job.entry:JobEntry.FileExists.Tooltip</tooltip> <iconfile>ui/images/FEX.svg</iconfile> <documentation_url>Products/File_Exists_(Job_Entry)</documentation_url> <cases_url/> <forum_url/> </job-entry>
<job-entry id="EVAL"> <description>i18n:org.pentaho.di.job.entry:JobEntry.Evaluation.TypeDesc</description> <classname>org.pentaho.di.job.entries.eval.JobEntryEval</classname> <category>i18n:org.pentaho.di.job:JobCategory.Category.Scripting</category> <tooltip>i18n:org.pentaho.di.job.entry:JobEntry.Evaluation.Tooltip</tooltip> <iconfile>ui/images/SCR_mod.svg</iconfile> <documentation_url>http://wiki.pentaho.com/display/EAI/Evaluating+conditions+in+The+JavaScript+job+entry</documentation_url> <cases_url/> <forum_url/> </job-entry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ JobEntry.SimpleEval.TypeDesc=Simple evaluation
JobEntry.SimpleEval.Tooltip=Evaluate one field or variable
JobEntry.SNMPTrap.TypeDesc=Send SNMP trap
JobEntry.SNMPTrap.Tooltip=Send SNMP trap to a target host
JobEntry.FTPSGet.TypeDesc=Get a file with FTPS
JobEntry.FTPSGet.Tooltip=Get a file with FTP secure
JobEntry.FTPSPut.TypeDesc=Upload files to FTPS
JobEntry.FTPSPut.Tooltip=Upload files to a FTP secure
JobEntry.CheckDbConnections.TypeDesc=Check DB connections
JobEntry.CheckDbConnections.Tooltip=Check if we can connect to one or several databases.
JobEntry.Syslog.TypeDesc=Send information using syslog
Expand Down
1 change: 1 addition & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ __List of the current core plugins:__
* dummy
* gpload
* get-file-sftp
* ftps
* sftpput
* hl7
* json
Expand Down
6 changes: 6 additions & 0 deletions plugins/ftp-delete/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,11 @@
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>ftps-plugin-impl</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package org.pentaho.di.job.entries.ftpdelete;

import org.pentaho.di.core.annotations.JobEntry;
import org.pentaho.di.job.entries.ftpsget.FTPSConnection;
import org.pentaho.di.job.entry.validator.AndValidator;
import org.pentaho.di.job.entry.validator.JobEntryValidatorUtils;

Expand Down Expand Up @@ -50,7 +51,6 @@
import org.pentaho.di.core.xml.XMLHandler;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.job.JobMeta;
import org.pentaho.di.job.entries.ftpsget.FTPSConnection;
import org.pentaho.di.job.entries.sftp.SFTPClient;
import org.pentaho.di.job.entry.JobEntryBase;
import org.pentaho.di.job.entry.JobEntryInterface;
Expand Down
55 changes: 55 additions & 0 deletions plugins/ftps/assemblies/plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>ftps-assemblies</artifactId>
<version>10.1.0.0-SNAPSHOT</version>
</parent>

<artifactId>ftps-plugin</artifactId>
<version>10.1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>PDI FTPS Plugin Distribution</name>
<description></description>

<dependencies>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>ftps-plugin-impl</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>ftps-plugin-ui</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>add-libs</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/assembly/lib</outputDirectory>
<includeScope>compile</includeScope>
<excludeArtifactIds>ftps-plugin-impl,ftps-plugin-ui</excludeArtifactIds>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
37 changes: 37 additions & 0 deletions plugins/ftps/assemblies/plugin/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>ftps-plugin</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory>ftps-plugin</baseDirectory>

<files>
<file>
<source>${project.basedir}/src/main/resources/version.xml</source>
<outputDirectory>.</outputDirectory>
<filtered>true</filtered>
</file>
</files>

<fileSets>
<!-- the staging dir -->
<fileSet>
<directory>${project.build.directory}/assembly</directory>
<outputDirectory>.</outputDirectory>
</fileSet>
</fileSets>

<dependencySets>
<dependencySet>
<outputDirectory>.</outputDirectory>
<includes>
<include>org.pentaho.di.plugins:ftps-plugin-impl:jar</include>
<include>org.pentaho.di.plugins:ftps-plugin-ui:jar</include>
</includes>
<useProjectArtifact>false</useProjectArtifact>
</dependencySet>
</dependencySets>
</assembly>


2 changes: 2 additions & 0 deletions plugins/ftps/assemblies/plugin/src/main/resources/version.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<version>${project.version}</version>
22 changes: 22 additions & 0 deletions plugins/ftps/assemblies/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>ftps</artifactId>
<version>10.1.0.0-SNAPSHOT</version>
</parent>

<artifactId>ftps-assemblies</artifactId>
<version>10.1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>PDI FTPS Plugins Assemblies</name>

<modules>
<module>plugin</module>
</modules>
</project>
58 changes: 58 additions & 0 deletions plugins/ftps/impl/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>ftps</artifactId>
<version>10.1.0.0-SNAPSHOT</version>
</parent>

<artifactId>ftps-plugin-impl</artifactId>
<name>PDI FTPS Impl</name>

<dependencies>
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-engine</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.healthmarketscience.jackcess</groupId>
<artifactId>jackcess</artifactId>
<scope>compile</scope>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-core</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>pentaho-kettle</groupId>
<artifactId>kettle-engine</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2018 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2023 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand All @@ -22,15 +22,7 @@

package org.pentaho.di.job.entries.ftpsget;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;

import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.io.IOUtils;
import org.apache.commons.vfs2.FileObject;
import org.ftp4che.FTPConnection;
Expand All @@ -49,7 +41,14 @@
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.job.entries.ftpsget.ftp4che.SecureDataFTPConnection;

import com.google.common.annotations.VisibleForTesting;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;

public class FTPSConnection implements FTPListener {

Expand Down Expand Up @@ -107,7 +106,7 @@ public FTPSConnection( int connectionType, String hostname, int port, String use
}

public FTPSConnection( int connectionType, String hostname, int port, String username, String password,
VariableSpace nameSpace ) {
VariableSpace nameSpace ) {
this.hostName = hostname;
this.portNumber = port;
this.userName = username;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2023 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand All @@ -22,37 +22,30 @@

package org.pentaho.di.job.entries.ftpsget;

import org.pentaho.di.job.entry.validator.AndValidator;
import org.pentaho.di.job.entry.validator.JobEntryValidatorUtils;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.vfs2.FileObject;
import org.ftp4che.util.ftpfile.FTPFile;
import org.pentaho.di.cluster.SlaveServer;
import org.pentaho.di.core.CheckResultInterface;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.util.Utils;
import org.pentaho.di.core.Result;
import org.pentaho.di.core.ResultFile;
import org.pentaho.di.core.annotations.JobEntry;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.encryption.Encr;
import org.pentaho.di.core.exception.KettleDatabaseException;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.util.StringUtil;
import org.pentaho.di.core.util.Utils;
import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.vfs.KettleVFS;
import org.pentaho.di.core.xml.XMLHandler;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.job.JobMeta;
import org.pentaho.di.job.entry.JobEntryBase;
import org.pentaho.di.job.entry.JobEntryInterface;
import org.pentaho.di.job.entry.validator.AndValidator;
import org.pentaho.di.job.entry.validator.JobEntryValidatorUtils;
import org.pentaho.di.repository.ObjectId;
import org.pentaho.di.repository.Repository;
import org.pentaho.di.resource.ResourceEntry;
Expand All @@ -61,14 +54,26 @@
import org.pentaho.metastore.api.IMetaStore;
import org.w3c.dom.Node;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* This defines an FTPS job entry.
*
* @author Samatar
* @since 08-03-2010
*
*/

@JobEntry( id = "FTPS_GET", name = "JobEntry.FTPSGet.TypeDesc",
i18nPackageName = "org.pentaho.di.job.entries.ftpsget",
description = "JobEntry.FTPSGet.Tooltip",
categoryDescription = "i18n:org.pentaho.di.job:JobCategory.Category.FileTransfer",
image = "GFTPS.svg",
documentationUrl = "http://wiki.pentaho.com/display/EAI/Get+a+file+with+FTPS" )
public class JobEntryFTPSGet extends JobEntryBase implements Cloneable, JobEntryInterface {
private static Class<?> PKG = JobEntryFTPSGet.class; // for i18n purposes, needed by Translator2!!

Expand Down
Loading

0 comments on commit 6c24b6d

Please sign in to comment.