Bonjour,

J'utilise l'API FTP java "edtftpj.jar".
J'ai le code suivant provenant de Talend, le code n'est pas propre je le sais mais bon c'est un générateur qui l'envoie :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
 
 
try {
	/**
         * [tFTPPut_1 begin ] start
         */
 
	int nb_file_tFTPPut_1 = 0;
	com.enterprisedt.net.ftp.FTPClient ftptFTPPut_1 = new   com.enterprisedt.net.ftp.FTPClient();
	ftptFTPPut_1.setRemoteHost(ftpHost);
	ftptFTPPut_1.setRemotePort(ftpPort);
	ftptFTPPut_1.connect();
	ftptFTPPut_1.login(ftpUser, ftpPwd);
	java.util.List<java.util.Map<String, String>> listtFTPPut_1 = new java.util.ArrayList<java.util.Map<String, String>>();
	java.util.Map<String, String> maptFTPPut_10 = new java.util.HashMap<String, String>();
	maptFTPPut_10.put("fichier-*.txt", "");
	listtFTPPut_1.add(maptFTPPut_10);
	String remotedirtFTPPut_1 = new StringBuilder().append(
		ftpEmplacement).append("erase").append(
		java.io.File.separator).append("transaction").append(
 		java.io.File.separator).append("temp").append(
		java.io.File.separator).toString();
	 ;
	ftptFTPPut_1.chdir(remotedirtFTPPut_1);
	ftptFTPPut_1		.setType(com.enterprisedt.net.ftp.FTPTransferType.BINARY);
			String localdirtFTPPut_1 = repertoireFichierSortieValide;
			for (java.util.Map<String, String> maptFTPPut_1 :   listtFTPPut_1) {
		java.util.Set<String> keySettFTPPut_1 = maptFTPPut_1.keySet();
		for (String keytFTPPut_1 : keySettFTPPut_1) {
			String tempdirtFTPPut_1 = localdirtFTPPut_1;
			String filemasktFTPPut_1 = keytFTPPut_1;
			String dirtFTPPut_1 = null;
			String masktFTPPut_1 = filemasktFTPPut_1.replaceAll("\\\\",
				"/");
	   	        int itFTPPut_1 = masktFTPPut_1.lastIndexOf('/');
			if (itFTPPut_1 != -1) {
			dirtFTPPut_1 = masktFTPPut_1.substring(0, itFTPPut_1);
			masktFTPPut_1 = masktFTPPut_1.substring(itFTPPut_1 + 1);
			}
			if (dirtFTPPut_1 != null && !"".equals(dirtFTPPut_1))
				tempdirtFTPPut_1 = tempdirtFTPPut_1 + "/"
						+ dirtFTPPut_1;
			masktFTPPut_1 = masktFTPPut_1.replaceAll("\\.", "\\\\.")
					.replaceAll("\\*", ".*");
			final String finalMasktFTPPut_1 = masktFTPPut_1;
			java.io.File[] listingstFTPPut_1 = null;
			java.io.File filetFTPPut_1 = new java.io.File(
				tempdirtFTPPut_1);
			if (filetFTPPut_1.isDirectory()) {
			listingstFTPPut_1 = filetFTPPut_1
			.listFiles(new java.io.FileFilter() {
			public boolean accept(java.io.File pathname) {
				boolean result = false;
				if (pathname !=null && pathname.isFile()) {
			result = java.util.regex.Pattern.compile(finalMasktFTPPut_1).matcher(pathname.getName())
.find();
	}
	return result;
	}
	});
	}
	if (listingstFTPPut_1 != null) {
		for (int mtFTPPut_1 = 0; mtFTPPut_1 < listingstFTPPut_1.length; mtFTPPut_1++) {
			if (listingstFTPPut_1[mtFTPPut_1].getName().matches(masktFTPPut_1)) {									
 
			ftptFTPPut_1.put(tempdirtFTPPut_1+ "/"+ listingstFTPPut_1[mtFTPPut_1].getName(),listingstFTPPut_1[mtFTPPut_1].getName());												
                       nb_file_tFTPPut_1++;
					}
				}
			}
		}
	}
	ftptFTPPut_1.quit();
 
 
	} catch (Exception e) {
	  e.printStackTrace();
	}
Cette méthode sort en exception sur l'instruction "ftptFTPPut_1.quit();" :

java.io.IOException: Unexpected null reply received
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:855)
at com.enterprisedt.net.ftp.FTPControlSocket.sendCommand(FTPControlSocket.java:818)
at com.enterprisedt.net.ftp.FTPClient.quit(FTPClient.java:3488)
at Test.tFTPPut_1Process(Test.java:130)
at Test.main(Test.java:22)

Avez vous déja eu ce problème et comment le résoudre?

Merci.

Koko22