if ( file.isFile() ) { fxpFile(destination, file, new FTPFile(dstDir.toString() + "/" + srcDir.getName(), file.getName())); }else { fxpDirectory(destination, file, new FTPFile(dstDir  + "/" + srcDir.getName())); }
if ( !file.isDirectory() ) { fxpFile(destination, file, new FTPFile(dstDir.toString() + "/" + srcDir.getName(), file.getName())); }else { fxpDirectory(destination, file, new FTPFile(dstDir.getPath(), srcDir.getName(),true)); }
    public void fxpDirectory(FTPConnection destination, FTPFile srcDir, FTPFile dstDir) throws IOException,FtpWorkflowException,FtpIOException {    	if ( !srcDir.isDirectory() )    		throw new FtpFileNotFoundException("Downloading: " + srcDir.getName() + " is not possible, it's not a directory!");        if (!connectionSSCNActive && getConnectionSSCNType() == FTPConnection.SSCN_ON) {            setSecuredFxp(true);            connectionSSCNActive = true;        }                destination.makeDirectory(dstDir.toString() + "/" + srcDir.getName());    	        String listDir = srcDir.toString();        listDir = (listDir.endsWith("/") ? listDir.substring(0, listDir.length() -1) : listDir);        List<FTPFile> files = getDirectoryListing( listDir );    	    	Collections.sort( files );    	    	for(FTPFile file : files) {    		file.setPath( srcDir.toString() );    		if ( file.isFile() ) {    			fxpFile(destination, file, new FTPFile(dstDir.toString() + "/" + srcDir.getName(), file.getName()));    		}else {    			fxpDirectory(destination, file, new FTPFile(dstDir  + "/" + srcDir.getName()));    		}    	}                if (connectionSSCNActive && getConnectionSSCNType() == FTPConnection.SSCN_ON) {            setSecuredFxp(false);            connectionSSCNActive = false;        }    }    