RE: Read file from ftp server

Mushadiq Shaik, modified 7 Years ago. New Member Posts: 18 Join Date: 2/2/16 Recent Posts

 what are the dependencies for FTPClient in liferay 7 ?

thumbnail
Christoph Rabel, modified 7 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts

Assuming 7.0 here. We use the apache libraries. e.g.

Java:

import org.apache.commons.net.ftp.FTPClient;

 

build.gradle:

    compile group: 'commons-net', name: 'commons-net', version: '3.5'

 

If commons-net is missing, you need to deploy it on the Liferay server. If you just need it in that one module, you probably want to use "compileInclude" instead of "compile".

Mushadiq Shaik, modified 7 Years ago. New Member Posts: 18 Join Date: 2/2/16 Recent Posts
Christoph Rabel<p>Assuming 7.0 here. We use the apache libraries. e.g.</p>
<p>Java:</p>
<p>import org.apache.commons.net.ftp.FTPClient;</p>
<p>  </p>
<p>build.gradle:</p>
<p>    compile group: 'commons-net', name: 'commons-net', version: '3.5'</p>
<p> </p>
<p>If commons-net is missing, you need to deploy it on the Liferay
server. If you just need it in that one module, you probably want to
use &quot;compileInclude&quot; instead of &quot;compile&quot;.</p>
Hi following is my build.gradle 
dependencies {
    compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
    compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "2.0.0"
    compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
    compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
    compileOnly group: "jstl", name: "jstl", version: "1.2"
    compileOnly group: "org.osgi", name: "osgi.cmpn", version: "6.0.0"
    compile group: 'commons-lang', name: 'commons-lang', version: '2.6'
    compile group: 'commons-io', name: 'commons-io', version: '2.6'
    compile group: 'commons-net', name: 'commons-net', version: '3.6'
    
}


but if i use

FTPClient ftpClient = new FTPClient();

my module is not deploying.

Please help me
thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
but if i use FTPClient ftpClient = new FTPClient(); my module is not deploying.

What package is it waiting on? If you don't know how to determine that using Gogo shell, then if you follow David's blog post on Finding Bundle Dependencies to list out the packages your code is asking for, what does it say?