Giter Site home page Giter Site logo

spring-boot-ftp-client's Introduction

Build Status Coverage Status HitCount contributions welcome

Spring boot ftp client

Spring boot project for using Apache Commons FTPClient through a simplified interface.

Usage

Add the following dependency:

<dependency>
  <groupId>com.github.kuljaninemir</groupId>
  <artifactId>spring-boot-ftp-client</artifactId>
  <version>2.0.05</version>
</dependency>

Add the following to your application.yml:

ftp:
  username: username
  password: password
  server: server

Inject a FTPFileWriter like so:

@Inject
FTPFileWriter ftpFileWriter;

Connect and start using the FTPFileWriter

ftpFileWriter.open();
if(ftpFileWriter.isConnected()){
    ftpFileWriter.loadFile(path, outputstream);
    ftpFileWriter.saveFile(inputstream, remotepath, false);
    ftpFileWriter.saveFile(sourcepath, destpath, true);
}
ftpFileWriter.close();

Configuration

By default port 21 is used and keepAliveTimeout is not set. You can change both these things by supplying these additional properties:

ftp:
  port: 21
  keepAliveTimout: 10

If you want the FTPFileWriter to connect as soon as it's injected, you can set this:

ftp:
  autoStart: true

If you want to access the FTPClient object you can extend FTPFileWriterImpl and make it the primary bean, like this:

@Primary
@Component
public class FTPFileWriterImplExt extends FTPFileWriterImpl {
    public void doSomething(){
        //this.ftpClient is accessible here.
    }
}

Built With

  • Maven - Dependency Management

Versioning

I use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

spring-boot-ftp-client's People

Contributors

kuljaninemir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.