Index: src/main/java/org/ow2/petals/bc/sftp/SFTPClientPool.java
===================================================================
--- src/main/java/org/ow2/petals/bc/sftp/SFTPClientPool.java	(revision 15507)
+++ src/main/java/org/ow2/petals/bc/sftp/SFTPClientPool.java	(working copy)
@@ -26,6 +26,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.ow2.petals.bc.sftp.connection.SFTPConnectionInfo;
+import org.ow2.petals.bc.sftp.connection.SftpClientWrapper;
 
 import com.sshtools.j2ssh.SftpClient;
 import com.sshtools.j2ssh.SshClient;
@@ -45,7 +46,7 @@
     /**
      * The actual SFTP connections.
      */
-    private static Map<String, SftpClient> sftpClients = new ConcurrentHashMap<String, SftpClient>();
+    private static Map<String, SftpClientWrapper> sftpClients = new ConcurrentHashMap<String, SftpClientWrapper>();
 
     private static Map<String, SshClient> sshClients = new ConcurrentHashMap<String, SshClient>();
 
@@ -74,18 +75,27 @@
         final String key = info.getKey();
 
         // Retrieve the SSH client associated to the previous key
-        SftpClient client = sftpClients.get(key);
-        if (client != null && client.isClosed()) {
-            client = null;
-            cleanSFTPClient(info);
+        SftpClientWrapper clientWrapper = sftpClients.get(key);
+        if (clientWrapper != null) {
+        	SftpClient client = clientWrapper.getClient();
+        	if (client != null && client.isClosed()) {
+        		cleanSFTPClient(info);
+        		return createSFTPClient(info);
+        	}
+        	else if (clientWrapper.getTimestamp() + (info.getMaxIdleTime() * 60000) > System.currentTimeMillis()) {
+        		// Idle time expired
+        		cleanSFTPClient(info);
+        		return createSFTPClient(info);
+        	}
+        	else {
+        		// Idle time not expired
+        		clientWrapper.setTimestamp(System.currentTimeMillis());
+        		return client;
+        	}
         }
-
-        if (client == null) {
-            client = createSFTPClient(info);
-
+        else {
+        	return createSFTPClient(info);
         }
-
-        return client;
     }
 
     /**
@@ -94,18 +104,21 @@
      * @param info
      */
     public static final void cleanSFTPClient(final SFTPConnectionInfo info) {
-        SftpClient sftpClient = sftpClients.remove(info.getKey());
-        SshClient sshClient = sshClients.remove(info.getKey());
-        if (sftpClient != null) {
-            try {
-                sftpClient.quit();
-            } catch (IOException e) {
-                // do nothing
-            }
+        final SftpClientWrapper sftpClientWrapper = sftpClients.remove(info.getKey());
+        final SshClient sshClient = sshClients.remove(info.getKey());
+        if (sftpClientWrapper != null) {
+        	final SftpClient sftpClient = sftpClientWrapper.getClient();
+        	if (sftpClient != null) {
+	            try {
+	                sftpClient.quit();
+	            } catch (IOException e) {
+	                // do nothing
+	            }
+        	}
         }
 
-        if (sshClient != null) {
-            sshClient.disconnect();
+    	if (sshClient != null) {
+    		sshClient.disconnect();
         }
     }
 
@@ -195,7 +208,7 @@
             throw new SftpClientPoolException(e.getMessage(), e);
         }
 
-        SFTPClientPool.sftpClients.put(info.getKey(), sftpClient);
+        SFTPClientPool.sftpClients.put(info.getKey(), new SftpClientWrapper(sftpClient, System.currentTimeMillis()));
         SFTPClientPool.sshClients.put(info.getKey(), sshClient);
 
         return sftpClient;
Index: src/main/java/org/ow2/petals/bc/sftp/SFTPConstants.java
===================================================================
--- src/main/java/org/ow2/petals/bc/sftp/SFTPConstants.java	(revision 15507)
+++ src/main/java/org/ow2/petals/bc/sftp/SFTPConstants.java	(working copy)
@@ -42,6 +42,11 @@
      */
     public static final String DEFAULT_FILENAME = "content.xml";
 
+    /**
+     * Default max idle connection time (minutes).
+     */
+    public static final long DEFAULT_SSH_MAX_IDLE_TIME = 10;
+
     //--------------------------------------------------------------------------
     // XML configuration.
     //--------------------------------------------------------------------------
@@ -90,6 +95,11 @@
      */
     public static final String SFTP_FILENAME = "filename";
 
+    /**
+     * The SFTP max idle connection time element (minutes).
+     */
+    public static final String SFTP_MAX_IDLE_TIME = "max-idle-time";
+
     //Authentication related part-----------------------------------------------
 
     public static final String SSH_AUTHENTICATION = "SSH Authentication";
Index: src/main/java/org/ow2/petals/bc/sftp/connection/SFTPConnectionInfo.java
===================================================================
--- src/main/java/org/ow2/petals/bc/sftp/connection/SFTPConnectionInfo.java	(revision 15507)
+++ src/main/java/org/ow2/petals/bc/sftp/connection/SFTPConnectionInfo.java	(working copy)
@@ -55,14 +55,19 @@
     
 
     /**
-     * Default direcory on the SftpServer for the specified user
+     * Default directory on the SftpServer for the specified user
      */
     private String defaultDirectory;
     
+    /**
+     * Max idle time of the connection
+     */
+    private long maxIdleTime;
+    
    
 
     //TODO : add some documentation here
-    public SFTPConnectionInfo(final String server, final String port, final SshAuthentication sshAuthentication, final String directory) throws ConfigurationException  {
+    public SFTPConnectionInfo(final String server, final String port, final SshAuthentication sshAuthentication, final String directory, final long maxIdleTime) throws ConfigurationException  {
         this.server = server;
 
         //For the SSH port
@@ -74,6 +79,7 @@
         
         this.sshAuthentication = sshAuthentication;
         this.directory = directory;
+        this.maxIdleTime = maxIdleTime;
 
         //Validates the current configuration
         this.validate();
@@ -141,6 +147,14 @@
     public void setDefaultDirectory(String defaultDirectory) {
         this.defaultDirectory = defaultDirectory;
     }
+    
+    /**
+     * Accessor on the max idle time of the connection
+     * @return
+     */
+    public long getMaxIdleTime() {
+    	return this.maxIdleTime;
+    }
 
     /**
      * Checks if the SU configuration seems to be valid or not.
Index: src/main/java/org/ow2/petals/bc/sftp/connection/SFTPConnectionInfoBuilder.java
===================================================================
--- src/main/java/org/ow2/petals/bc/sftp/connection/SFTPConnectionInfoBuilder.java	(revision 15507)
+++ src/main/java/org/ow2/petals/bc/sftp/connection/SFTPConnectionInfoBuilder.java	(working copy)
@@ -57,6 +57,7 @@
         Node privateKeyNode = null;
         Node passphraseNode = null;
         Node directoryNode = null;
+        Node maxIdleTimeNode = null;
 
         SshAuthentication sshAuthentication = null;
         SFTPConnectionInfo result = null;
@@ -69,6 +70,7 @@
         privateKeyNode = XMLUtil.findChild(node, SFTPConstants.SFTP_PRIVATE_KEY, null, false);
         passphraseNode = XMLUtil.findChild(node, SFTPConstants.SFTP_PASSPHRASE, null, false);
         directoryNode = XMLUtil.findChild(node, SFTPConstants.SFTP_FOLDER, null, false);
+        maxIdleTimeNode = XMLUtil.findChild(node, SFTPConstants.SFTP_MAX_IDLE_TIME, null, false);
         
         //If the user node is empty
         if (userNode == null) {
@@ -107,7 +109,8 @@
                 ((hostNode != null) ? hostNode.getTextContent() : null),
                 ((portNode != null) ? portNode.getTextContent() : null),
                 sshAuthentication,
-                ((directoryNode != null) ? directoryNode.getTextContent() : null));
+                ((directoryNode != null) ? directoryNode.getTextContent() : null),
+                ((maxIdleTimeNode != null) ? Long.parseLong(maxIdleTimeNode.getTextContent()) : SFTPConstants.DEFAULT_SSH_MAX_IDLE_TIME));
 
         return result;
     }
@@ -132,6 +135,7 @@
         final String privateKey = extensions.get(SFTPConstants.SFTP_PRIVATE_KEY);
         final String passphrase = extensions.get(SFTPConstants.SFTP_PASSPHRASE);
         final String directory = extensions.get(SFTPConstants.SFTP_FOLDER);
+        final String maxIdleTime = extensions.get(SFTPConstants.SFTP_MAX_IDLE_TIME);
         
         //Checks if there's only one authentication mode (ie if password => no private key & no passphrase
         if (((password != null) && (privateKey != null)) || ((password != null) && (passphrase != null))) {
@@ -155,6 +159,6 @@
             throw new ConfigurationException("No authentication informations found");
         }
 
-        return new SFTPConnectionInfo(host, port, sshAuthentication, directory);
+        return new SFTPConnectionInfo(host, port, sshAuthentication, directory, Long.parseLong(maxIdleTime));
     }
 }
Index: src/main/java/org/ow2/petals/bc/sftp/connection/SftpClientWrapper.java
===================================================================
--- src/main/java/org/ow2/petals/bc/sftp/connection/SftpClientWrapper.java	(revision 0)
+++ src/main/java/org/ow2/petals/bc/sftp/connection/SftpClientWrapper.java	(revision 0)
@@ -0,0 +1,33 @@
+package org.ow2.petals.bc.sftp.connection;
+
+import com.sshtools.j2ssh.SftpClient;
+
+public class SftpClientWrapper {
+	
+	private SftpClient client;
+	
+	private long lastUsageTimestamp;
+	
+	public SftpClientWrapper(final SftpClient client, final long lastUsageTimestamp) {
+		super();
+		this.client = client;
+		this.lastUsageTimestamp = lastUsageTimestamp;
+	}
+	
+	public final void setTimestamp(final long timestamp) {
+		this.lastUsageTimestamp = timestamp;
+	}
+
+	public void setClient(SftpClient client) {
+		this.client = client;
+	}
+
+	public SftpClient getClient() {
+		return this.client;
+	}
+
+	public long getTimestamp() {
+		return this.lastUsageTimestamp;
+	}
+
+}
Index: src/main/resources/SFTPextensions.xsd
===================================================================
--- src/main/resources/SFTPextensions.xsd	(revision 15507)
+++ src/main/resources/SFTPextensions.xsd	(working copy)
@@ -56,5 +56,12 @@
 		</xs:annotation>
 	</xs:element>
 
+    <!-- max idle connection time -->
+    <xs:element name="max-idle-time" type="xs:string">
+		<xs:annotation>
+			<xs:documentation>Max idle connection time (minutes)</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+
     <!-- TODO : more to come about compression -->
 </xs:schema>
\ No newline at end of file
Index: src/main/resources/SFTPjbi.xsd
===================================================================
--- src/main/resources/SFTPjbi.xsd	(revision 15507)
+++ src/main/resources/SFTPjbi.xsd	(working copy)
@@ -29,6 +29,8 @@
 							minOccurs="0" />
                         <xs:element ref="ftp:folder" maxOccurs="1"
 							minOccurs="0" />
+						<xs:element ref="ftp:max-idle-time" maxOccurs="1"
+							minOccurs="0" />
 
                         <!-- TODO : more to come about compression -->
                     </xs:sequence>
Index: src/main/resources/sftpInterface.wsdl
===================================================================
--- src/main/resources/sftpInterface.wsdl	(revision 15507)
+++ src/main/resources/sftpInterface.wsdl	(working copy)
@@ -23,6 +23,7 @@
                     <xsd:element name="user" type="xsd:string"></xsd:element>
                     <xsd:element name="password" type="xsd:string"></xsd:element>
                     <xsd:element name="folder" type="xsd:string"></xsd:element>
+                    <xsd:element name="max-idle-time" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                 </xsd:sequence>
             </xsd:complexType>
 
