Skip to content

Commit 929a04d

Browse files
committed
Update for Java 21
Migrate all code and dependencies to Java21 from Java 17. Remove unnecessary .jar's and amend deprecated API calls.
1 parent 8432503 commit 929a04d

File tree

10 files changed

+149
-115
lines changed

10 files changed

+149
-115
lines changed

b6sftpSend/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Java 17 JDK">
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Java 21 JDK">
44
<attributes>
55
<attribute name="module" value="true"/>
66
</attributes>

b6sftpSend/.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>b6sftpSend</name>
3+
<name>b7sftpSend</name>
44
<comment></comment>
55
<projects>
66
</projects>

b6sftpSend/.settings/org.eclipse.jdt.core.prefs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
33
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
44
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
55
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6-
org.eclipse.jdt.core.compiler.compliance=17
6+
org.eclipse.jdt.core.compiler.compliance=21
77
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
88
org.eclipse.jdt.core.compiler.debug.localVariable=generate
99
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<faceted-project>
3-
<runtime name="Java 17 JDK"/>
4-
<installed facet="java" version="17"/>
3+
<runtime name="Java 21 JDK"/>
4+
<installed facet="java" version="21"/>
55
</faceted-project>
File renamed without changes.

b6sftpSend/build.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
To include a user specific buildfile here, simply create one in the same
55
directory with the processing instruction <?eclipse.ant.import?>
66
as the first entry and export the buildfile again. -->
7-
<project basedir="." default="build" name="b6sftpSend">
7+
<project basedir="." default="build" name="b7sftpSend">
88
<property environment="env"/>
99
<property name="debuglevel" value="source,lines,vars"/>
10-
<property name="target" value="17"/>
11-
<property name="source" value="17"/>
12-
<path id="b6sftpSend.classpath">
10+
<property name="target" value="21"/>
11+
<property name="source" value="21"/>
12+
<path id="b7sftpSend.classpath">
1313
<pathelement location="bin"/>
1414
<fileset dir="lib">
1515
<include name="**/*.jar"/>
1616
</fileset>
1717
</path>
1818
<target name="init">
1919
<mkdir dir="bin"/>
20-
<copy includeemptydirs="false" todir="bin">
21-
<fileset dir="src">
20+
<copy includeemptydirs="false" todir="bin" overwrite="true" preservelastmodified="true">
21+
<fileset dir="src" excludes="**/doc-files/**">
2222
<exclude name="**/*.launch"/>
2323
<exclude name="**/*.java"/>
2424
</fileset>
@@ -34,7 +34,8 @@
3434
<echo message="${ant.project.name}: ${ant.file}"/>
3535
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
3636
<src path="src"/>
37-
<classpath refid="b6sftpSend.classpath"/>
37+
<classpath refid="b7sftpSend.classpath"/>
38+
<compilerarg value="-proc:full"/>
3839
</javac>
3940
</target>
4041
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>

b6sftpSend/sftpSend.jar

-16 Bytes
Binary file not shown.

b6sftpSend/src/com/commander4j/sftp/Transfer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class Transfer extends Thread
4747
public static JUtility utils = new JUtility();
4848
public static EmailQueue emailqueue = new EmailQueue();
4949
public static EmailThread emailthread;
50-
public static String version = "4.60";
50+
public static String version = "4.70";
5151
public static Long pollFrequencySeconds = (long) 0;
5252

5353
public static void main(String[] args)

b6sftpSend/xml/config/email.xml

Lines changed: 93 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,95 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<emailSettings>
3-
<!-- Example Version-->
4-
<!-- The section called "configuration" is always the active one - rename as appropriate-->
5-
<!-- SMTP No Authentication Example -->
6-
<configuration2>
7-
<property name="mail.smtp.starttls.enable" encrypted="no" value="false"/>
8-
<property name="mail.smtp.host" encrypted="no" value="smtp.demo.com"/>
9-
<property name="mail.smtp.socketFactory.port" encrypted="no" value="25"/>
10-
<property name="mail.smtp.user" encrypted="no" value="demo@email.com"/>
11-
<property name="mail.smtp.password" encrypted="no" value=""/>
12-
<property name="mail.smtp.socketFactory.class" encrypted="no" value="javax.net.ssl.SSLSocketFactory"/>
13-
<property name="mail.smtp.auth" encrypted="no" value="false"/>
14-
<property name="mail.smtp.port" encrypted="no" value="25"/>
15-
<property name="mail.smtp.from" encrypted="no" value="demo@email.com"/>
16-
<property name="mail.debug" encrypted="no" value="true"/>
17-
</configuration2>
18-
<!-- Microsoft smtp.live.com Example -->
19-
<configuration>
20-
<property name="mail.smtp.auth" encrypted="no" value="true"/>
21-
<property name="mail.smtp.starttls.enable" encrypted="no" value="true"/>
22-
<property name="mail.smtp.host" encrypted="no" value="smtp.live.com"/>
23-
<property name="mail.smtp.socketFactory.port" encrypted="no" value="25"/>
24-
<property name="mail.smtp.user" encrypted="no" value="email@outlook.com"/>
25-
<property name="mail.smtp.password" encrypted="no" value="password"/>
26-
<property name="mail.smtp.socketFactory.class" encrypted="no" value="javax.net.ssl.SSLSocketFactory"/>
27-
<property name="mail.smtp.auth" encrypted="no" value="true"/>
28-
<property name="mail.smtp.port" encrypted="no" value="25"/>
29-
<property name="mail.smtp.from" encrypted="no" value="email@outlook.com"/>
30-
<property name="mail.debug" encrypted="no" value="true"/>
31-
</configuration>
32-
<!-- Google gmail Example -->
33-
<configuration1>
34-
<property name="mail.smtp.auth" encrypted="no" value="true"/>
35-
<property name="mail.smtp.starttls.enable" encrypted="no" value="true"/>
36-
<property name="mail.smtp.host" encrypted="no" value="smtp.gmail.com"/>
37-
<property name="mail.smtp.socketFactory.port" encrypted="no" value="465"/>
38-
<property name="mail.smtp.user" encrypted="no" value="email@gmail.com"/>
39-
<property name="mail.smtp.password" encrypted="no" value="password"/>
40-
<property name="mail.smtp.socketFactory.class" encrypted="no" value="javax.net.ssl.SSLSocketFactory"/>
41-
<property name="mail.smtp.auth" encrypted="no" value="true"/>
42-
<property name="mail.smtp.port" encrypted="no" value="465"/>
43-
<property name="mail.smtp.from" encrypted="no" value="email@gmail.com"/>
44-
<property name="mail.debug" encrypted="no" value="true"/>
45-
</configuration1>
46-
<!-- Distribution Lists are referred to within message mapping Config.xml -->
47-
<distributionList id="StartStop" enabled="N" maxFrequencyMins="0">
48-
<toAddressList>example@email.com</toAddressList>
49-
</distributionList>
50-
<distributionList id="LabelSync" enabled="N" maxFrequencyMins="0">
51-
<toAddressList>example@email.com</toAddressList>
52-
</distributionList>
53-
<distributionList id="Logs" enabled="Y" maxFrequencyMins="0">
54-
<toAddressList>example@email.com</toAddressList>
55-
</distributionList>
56-
<distributionList id="Config" enabled="Y" maxFrequencyMins="0">
57-
<toAddressList>example@email.com</toAddressList>
58-
</distributionList>
59-
<distributionList id="Monitor" enabled="Y" maxFrequencyMins="0">
60-
<toAddressList>example@email.com</toAddressList>
61-
</distributionList>
62-
<distributionList id="Info" enabled="Y" maxFrequencyMins="0">
63-
<toAddressList>example@email.com</toAddressList>
64-
</distributionList>
65-
<distributionList id="Error" enabled="Y" maxFrequencyMins="5">
66-
<toAddressList>example@email.com</toAddressList>
67-
</distributionList>
68-
<distributionList id="SSCC" enabled="Y" maxFrequencyMins="5">
69-
<toAddressList>example@email.com</toAddressList>
70-
</distributionList>
71-
<distributionList id="OrderAssigned" enabled="Y" maxFrequencyMins="0">
72-
<toAddressList>example@email.com</toAddressList>
73-
</distributionList>
2+
<emailSettings>
3+
4+
<!-- Example Version-->
5+
6+
<!-- The section called "configuration" is always the active one - rename as appropriate-->
7+
8+
<!-- SMTP No Authentication Example -->
9+
10+
<configuration2>
11+
<property name="mail.smtp.starttls.enable" value="false"/>
12+
<property name="mail.smtp.host" value="smtp.demo.com"/>
13+
<property name="mail.smtp.socketFactory.port" value="25"/>
14+
<property name="mail.smtp.user" value="demo@email.com"/>
15+
<property name="mail.smtp.password" value=""/>
16+
<property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory"/>
17+
<property name="mail.smtp.auth" value="false"/>
18+
<property name="mail.smtp.port" value="25"/>
19+
<property name="mail.smtp.from" value="demo@email.com"/>
20+
<property name="mail.debug" value="true"/>
21+
</configuration2>
22+
23+
<!-- Microsoft smtp.live.com Example -->
24+
25+
<configuration>
26+
<property name="mail.smtp.auth" value="true"/>
27+
<property name="mail.smtp.starttls.enable" value="true"/>
28+
<property name="mail.smtp.host" value="smtp.live.com"/>
29+
<property name="mail.smtp.socketFactory.port" value="25"/>
30+
<property name="mail.smtp.user" value="email@outlook.com"/>
31+
<property name="mail.smtp.password" value="password"/>
32+
<property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory"/>
33+
<property name="mail.smtp.auth" value="true"/>
34+
<property name="mail.smtp.port" value="25"/>
35+
<property name="mail.smtp.from" value="email@outlook.com"/>
36+
<property name="mail.debug" value="true"/>
37+
</configuration>
38+
39+
<!-- Google gmail Example -->
40+
41+
<configuration1>
42+
<property name="mail.smtp.auth" value="true"/>
43+
<property name="mail.smtp.starttls.enable" value="true"/>
44+
<property name="mail.smtp.host" value="smtp.gmail.com"/>
45+
<property name="mail.smtp.socketFactory.port" value="465"/>
46+
<property name="mail.smtp.user" value="email@gmail.com"/>
47+
<property name="mail.smtp.password" value="password"/>
48+
<property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory"/>
49+
<property name="mail.smtp.auth" value="true"/>
50+
<property name="mail.smtp.port" value="465"/>
51+
<property name="mail.smtp.from" value="email@gmail.com"/>
52+
<property name="mail.debug" value="true"/>
53+
</configuration1>
54+
55+
56+
<!-- Distribution Lists are referred to within message mapping Config.xml -->
57+
58+
<distributionList id="StartStop" enabled="N" maxFrequencyMins="0">
59+
<toAddressList>example@email.com</toAddressList>
60+
</distributionList>
61+
62+
<distributionList id="LabelSync" enabled="N" maxFrequencyMins="0">
63+
<toAddressList>example@email.com</toAddressList>
64+
</distributionList>
65+
66+
<distributionList id="Logs" enabled="Y" maxFrequencyMins="0">
67+
<toAddressList>example@email.com</toAddressList>
68+
</distributionList>
69+
70+
<distributionList id="Config" enabled="Y" maxFrequencyMins="0">
71+
<toAddressList>example@email.com</toAddressList>
72+
</distributionList>
73+
74+
<distributionList id="Monitor" enabled="Y" maxFrequencyMins="0">
75+
<toAddressList>example@email.com</toAddressList>
76+
</distributionList>
77+
78+
<distributionList id="Info" enabled="Y" maxFrequencyMins="0">
79+
<toAddressList>example@email.com</toAddressList>
80+
</distributionList>
81+
82+
<distributionList id="Error" enabled="Y" maxFrequencyMins="5">
83+
<toAddressList>example@email.com</toAddressList>
84+
</distributionList>
85+
86+
<distributionList id="SSCC" enabled="Y" maxFrequencyMins="5">
87+
<toAddressList>example@email.com</toAddressList>
88+
</distributionList>
89+
90+
<distributionList id="OrderAssigned" enabled="Y" maxFrequencyMins="0">
91+
<toAddressList>example@email.com</toAddressList>
92+
</distributionList>
93+
94+
7495
</emailSettings>

b6sftpSend/xml/config/sftpSend.xml

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,47 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<config>
3-
<!-- Example Version-->
4-
<!-- Standard username and password logon example -->
5-
<sftpSend2>
3+
4+
<!-- Example Version-->
5+
6+
<!-- Standard username and password logon example -->
7+
8+
<sftpSend2>
9+
610
<general>
7-
<value id="title" encrypted="no">SFTP Example</value>
8-
<value id="emailEnabled" encrypted="no">false</value>
11+
<value id="title" encrypted="no">SFTP Example</value>
12+
<value id="emailEnabled" encrypted="no">false</value>
913
</general>
10-
<security>
11-
<value id="remoteHost" encrypted="no">1.2.3.4</value>
12-
<value id="remotePort" encrypted="no">22</value>
13-
<value id="checkKnownHosts" encrypted="no">no</value>
14-
<value id="knownHostsFile" encrypted="no">./ssh/known_hosts</value>
15-
<value id="authType" encrypted="no">user password</value>
16-
<value id="username" encrypted="no">testuser</value>
17-
<value id="password" encrypted="no">testpassword</value>
18-
<value id="privateKeyFile" encrypted="no">./ssh/sftpSend</value>
19-
<value id="privateKeyPasswordProtected" encrypted="no">no</value>
20-
<value id="privateKeyPassword" encrypted="no"/>
21-
</security>
22-
<source>
23-
<value id="localDir" encrypted="no">./send/</value>
24-
<value id="localFileMask" encrypted="no">*.xml</value>
25-
<value id="backupDir" encrypted="no"/>
26-
<value id="pollFrequencySeconds" encrypted="no">5000</value>
27-
</source>
28-
<destination>
29-
<value id="remoteDir" encrypted="no">/remote/</value>
30-
<value id="tempFileExtension" encrypted="no">.tmp</value>
31-
</destination>
32-
</sftpSend2>
33-
<!-- public key and username example - comment out above and uncomment below to use -->
34-
<!-- <sftpSend2>
14+
15+
<security>
16+
<value id="remoteHost" encrypted="no">1.2.3.4</value>
17+
<value id="remotePort" encrypted="no">22</value>
18+
<value id="checkKnownHosts" encrypted="no">no</value>
19+
<value id="knownHostsFile" encrypted="no">./ssh/known_hosts</value>
20+
<value id="authType" encrypted="no">user password</value>
21+
<value id="username" encrypted="no">testuser</value>
22+
<value id="password" encrypted="no">testpassword</value>
23+
<value id="privateKeyFile" encrypted="no">./ssh/sftpSend</value>
24+
<value id="privateKeyPasswordProtected" encrypted="no">no</value>
25+
<value id="privateKeyPassword" encrypted="no"/>
26+
</security>
27+
28+
<source>
29+
<value id="localDir" encrypted="no">./send/</value>
30+
<value id="localFileMask" encrypted="no">*.xml</value>
31+
<value id="backupDir" encrypted="no"></value>
32+
<value id="pollFrequencySeconds" encrypted="no">5000</value>
33+
</source>
34+
35+
<destination>
36+
<value id="remoteDir" encrypted="no">/remote/</value>
37+
<value id="tempFileExtension" encrypted="no">.tmp</value>
38+
</destination>
39+
40+
</sftpSend2>
41+
42+
<!-- public key and username example - comment out above and uncomment below to use -->
43+
44+
<!-- <sftpSend2>
3545
3646
<security>
3747
<value id="remoteHost" encrypted="no">1.2.3.4</value>
@@ -57,4 +67,6 @@
5767
</destination>
5868
5969
</sftpSend2> -->
70+
71+
6072
</config>

0 commit comments

Comments
 (0)