提交 26a6389b 编写于 作者: 1 1537639

Merge branch 'master' of https://gitcode.net/qq_51543278/ftpsystem

# Conflicts:
#	out/production/ftpsystem/ftp/Connect.class
#	out/production/ftpsystem/ftp/DeleteFiles.class
#	out/production/ftpsystem/ftp/Download.class
#	out/production/ftpsystem/ftp/FTPmain.class
#	out/production/ftpsystem/ftp/Upload.class
#	src/ftp/DeleteFiles.java
#	src/ftp/Download.java
#	src/ftp/FTPmain.java
#	src/ftp/Upload.java
......@@ -2,11 +2,5 @@
<project version="4">
<component name="JUnitGeneratorProjectSettings">
<option name="selectedTemplateKey" value="JUnit 4" />
<option name="vmTemplates">
<map>
<entry key="JUnit 3" value="######################################################################################## &#10;## &#10;## Available variables: &#10;## $entryList.methodList - List of method composites &#10;## $entryList.privateMethodList - List of private method composites &#10;## $entryList.fieldList - ArrayList of class scope field names &#10;## $entryList.className - class name &#10;## $entryList.packageName - package name &#10;## $today - Todays date in MM/dd/yyyy format &#10;## &#10;## MethodComposite variables: &#10;## $method.name - Method Name &#10;## $method.signature - Full method signature in String form &#10;## $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods) &#10;## $method.paramNames - List of Strings representing the method's parameters' names &#10;## $method.paramClasses - List of Strings representing the method's parameters' classes &#10;## &#10;## You can configure the output class name using &quot;testClass&quot; variable below. &#10;## Here are some examples: &#10;## Test${entry.ClassName} - will produce TestSomeClass &#10;## ${entry.className}Test - will produce SomeClassTest &#10;## &#10;######################################################################################## &#10;## &#10;#macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end &#10;## Iterate through the list and generate testcase for every entry. &#10;#foreach ($entry in $entryList) &#10;#set( $testClass=&quot;${entry.className}Test&quot;) &#10;## &#10;package test.$entry.packageName; &#10;&#10;import junit.framework.Test; &#10;import junit.framework.TestSuite; &#10;import junit.framework.TestCase; &#10;&#10;/** &#10;* ${entry.className} Tester. &#10;* &#10;* @author &lt;Authors name&gt; &#10;* @since &lt;pre&gt;$today&lt;/pre&gt; &#10;* @version 1.0 &#10;*/ &#10;public class $testClass extends TestCase { &#10;public $testClass(String name) { &#10;super(name); &#10;} &#10;&#10;public void setUp() throws Exception { &#10;super.setUp(); &#10;} &#10;&#10;public void tearDown() throws Exception { &#10;super.tearDown(); &#10;} &#10;&#10;#foreach($method in $entry.methodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;} &#10;&#10;#end &#10;&#10;#foreach($method in $entry.privateMethodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;#foreach($string in $method.reflectionCode) &#10;$string &#10;#end &#10;} &#10;&#10;#end &#10;&#10;public static Test suite() { &#10;return new TestSuite(${testClass}.class); &#10;} &#10;} &#10;#end" />
<entry key="JUnit 4" value="######################################################################################## &#10;## &#10;## Available variables: &#10;## $entryList.methodList - List of method composites &#10;## $entryList.privateMethodList - List of private method composites &#10;## $entryList.fieldList - ArrayList of class scope field names &#10;## $entryList.className - class name &#10;## $entryList.packageName - package name &#10;## $today - Todays date in MM/dd/yyyy format &#10;## &#10;## MethodComposite variables: &#10;## $method.name - Method Name &#10;## $method.signature - Full method signature in String form &#10;## $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods) &#10;## $method.paramNames - List of Strings representing the method's parameters' names &#10;## $method.paramClasses - List of Strings representing the method's parameters' classes &#10;## &#10;## You can configure the output class name using &quot;testClass&quot; variable below. &#10;## Here are some examples: &#10;## Test${entry.ClassName} - will produce TestSomeClass &#10;## ${entry.className}Test - will produce SomeClassTest &#10;## &#10;######################################################################################## &#10;## &#10;#macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end &#10;## Iterate through the list and generate testcase for every entry. &#10;#foreach ($entry in $entryList) &#10;#set( $testClass=&quot;${entry.className}Test&quot;) &#10;## &#10;package $entry.packageName; &#10;&#10;import org.junit.Test; &#10;import org.junit.Before; &#10;import org.junit.After; &#10;&#10;/** &#10;* ${entry.className} Tester. &#10;* &#10;* @author &lt;Authors name&gt; &#10;* @since &lt;pre&gt;$date&lt;/pre&gt; &#10;* @version 1.0 &#10;*/ &#10;public class $testClass { &#10;&#10;@Before&#10;public void before() throws Exception { &#10;} &#10;&#10;@After&#10;public void after() throws Exception { &#10;} &#10;&#10;#foreach($method in $entry.methodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;@Test&#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;} &#10;&#10;#end &#10;&#10;#foreach($method in $entry.privateMethodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;@Test&#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;#foreach($string in $method.reflectionCode) &#10;$string &#10;#end &#10;} &#10;&#10;#end &#10;} &#10;#end" />
</map>
</option>
</component>
</project>
\ No newline at end of file
123
\ No newline at end of file
1.上传重命名,不允许
2.UTF9 GBK中文
3.mlistFile不能识别为FTP文件
要测试您的服务器是否支持 MLST 命令,如果答案为 false,您可以只使用 listfiles() 方法...像我一样
http://t.zoukankan.com/LiuChunfu-p-6804437.html
String reply = getReplyStrings()[1];
旧的服务对目录列表仅支持LIST命令,这样FTP客户端会获得一个非用户友好的待解析的原始格式,仅仅只有FTP客户端知道它的意义。由于文件的时间戳基于服务器的时区,它使得在FTP对目录和文件同步时有许多的不同,因为没有方法获得服务器上当前文件的时间戳。
获取返回码其目的是为了判定FTP服务器是否支持MLST??有些FTPServer不支持?旧的服务对目录列表仅支持LIST命令,这样FTP客户端会获得一个非用户友好的待解析的原始格式,仅仅只有FTP客户端知道它的意义。由于文件的时间戳基于服务器的时区,它使得在FTP对目录和文件同步时有许多的不同,因为没有方法获得服务器上当前文件的时间戳。
https://blog.csdn.net/qq_31075287/article/details/111588525
4.服务器不稳定连接
cvshost允许防火墙
防火墙打开
5.如何在IIS上设置FTP被动模式的端口范围
windows2016服务器,管理员命令行窗口:
比如限制端口范围3000-3300,一行代码(numberofports最小值255):
netsh int ipv4 set dynamicport protocol=tcp startport=3000 numberofports=300
6.mkdirs()可以建立多级文件夹, mkdir()只会建立一级的文件夹
7.工作目录在多任务操作不可用
\ No newline at end of file
**课程名称**|**广工软件工程**
-|-
**班级信息**|[班级信息](https://bbs.csdn.net/forums/gdut-ryuezh)
**作业要求**|[作业要求](https://bbs.csdn.net/topics/608473572)
**项目链接**|[FTPsystem](https://gitcode.net/qq_51543278/ftpsystem)
敏捷冲刺:
每天举行站立式会议,讨论项目每个成员的昨天进展、存在问题、今天安排。
有效沟通项目的进度、问题、计划、调整。
提供当天站立式会议照片一张。
每个人的工作 (有work item 的ID):
- 昨天已完成的工作。
- 今天计划完成的工作。
- 工作中遇到的困难。
发布项目燃尽图;
- 请理解燃尽图横坐标和纵坐标指的是什么。
- 请理解燃尽图实线和虚线分别代表什么。
- 结合《构建之法》里的“项目收敛”相关内容理解燃尽图的作用。
- 燃尽图可以用手画, 可以用excel, 可以用自己选择的工具或者leangoo
每人的代码/文档签入记录:
- 签入记录对应的Issue内容与链接,代码必须每天可执行。
- 必要的code review,编码规范不是摆设,文档要随时更新。
适当的项目程序/模块的最新(运行)截图。
\ No newline at end of file
......@@ -89,6 +89,7 @@ public class Connect {//连接,需要用户名,密码(前两个有可能
System.out.println(e.getMessage());
e.printStackTrace();
}
System.out.println("服务器断开连接");
return ftpClient;
}
......
package ftp;
import org.apache.commons.net.ftp.FTPClient;
public class FTPtestforczc {
public static void main(String[] args){
FTPClient ftpClient=ftp.Connect.connectFtpServer("43.139.43.93",21,"user","Gdut2568","GBK");
ftp.Connect.isConnected(ftpClient);
ftp.DeleteFiles.deleteServerFiles(ftpClient,"/rdhf.png");
//ftp.Download.downloadSingleFile(ftpClient,"D:\\test","1.png");
/*ftp://1@43.139.43.93/11.10Test/rdhf.png
ftp://1@43.139.43.93/2.png
OK:ftp.DeleteFiles.deleteServerFiles(ftpClient,"/1.png");
*/
ftp.Connect.closeFTPConnect(ftpClient);
//Upload.CreateNewFolder(ftpClient,"test");
/*try {
System.out.println(ftpClient.printWorkingDirectory());
}
catch (Exception e)
{
System.out.println("fail");
}*/
}
}
package ftp;public class FtpPanel {
}
package ftp;
public class UI {
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class UI extends JFrame {
JButton jButton1 = new JButton("连接");
JButton jButton2 = new JButton("断开连接");
JButton jButton3 = new JButton("上传");
JButton jButton4 = new JButton("下载");
JTextField jTextField1 = new JTextField();
JTextField jTextField2 = new JTextField();
JTextField jTextField3 = new JTextField();
JPasswordField jPasswordField = new JPasswordField();
localPanel localpanel = new localPanel();
public UI (){
setTitle("ftp软件");
setLayout(null);
setBounds(0,0,1000,700);
Container c = getContentPane();
JLabel jLabel1 = new JLabel("ip地址");
JLabel jLabel2 = new JLabel("端口号");
JLabel jLabel3 = new JLabel("用户名");
JLabel jLabel4 = new JLabel("密码");
jButton1.addActionListener(new jButton1event());
jButton2.addActionListener(new jButton2event());
jButton3.addActionListener(new jButton3event());
jButton4.addActionListener(new jButton4event());
jLabel1.setBounds(30,20,40,20);
jLabel2.setBounds(210,20,40,20);
jLabel3.setBounds(390,20,40,20);
jLabel4.setBounds(570,20,40,20);
jTextField1.setBounds(70,20,130,20);
jTextField2.setBounds(250,20,130,20);
jTextField3.setBounds(430,20,130,20);
jPasswordField.setBounds(610,20,130,20);
jButton1.setBounds(750,20,60,20);
jButton2.setBounds(820,20,100,20);
jButton3.setBounds(30,50,90,40);
jButton4.setBounds(170,50,90,40);
localpanel.setBounds(30,110,500,300);
c.add(jLabel1);
c.add(jLabel2);
c.add(jLabel3);
c.add(jLabel4);
c.add(jTextField1);
c.add(jTextField2);
c.add(jTextField3);
c.add(jPasswordField);
c.add(jButton1);
c.add(jButton2);
c.add(jButton3);
c.add(jButton4);
c.add(localpanel);
setVisible(true);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
/*@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand() == "连接") {
if(jTextField1.getText()==null||jTextField2.getText()==""||jTextField3.getText()==""||jPasswordField.getText()==""){
JOptionPane .showMessageDialog(null,"输入不能为空","",JOptionPane.PLAIN_MESSAGE);
}
else{
//建立连接的代码
}
} else if (e.getActionCommand() == "断开连接") {//如果事件源是 jbClear,那么清除文本框的文字
//断开连接的代码
}
}*/
class jButton1event implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String password=new String(jPasswordField.getPassword());
if(jTextField1.getText().trim().equals("")||jTextField2.getText().trim().equals("")||jTextField3.getText().trim().equals("")||password.trim().equals("")){
JOptionPane.showMessageDialog(null,"输入不能为空","",JOptionPane.PLAIN_MESSAGE);
}
else{
//建立连接的操作
}
}
}
class jButton2event implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
//断开连接的操作
}
}
class jButton3event implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
String filepath = new String();
filepath = localpanel.getCurrentPath()+"\\"+localpanel.getfile1();
//System.out.println(filepath);
//文件路径为filepath,剩下的代码为上传操作。
}
}
class jButton4event implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
//下载操作
}
}
}
package ftp;public class localPanel {
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册