Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public void upload(InputStream inputStream) {
  2. String filename = "file.txt"
  3.  
  4. client = new FTPClient();
  5. try {
  6. client.connect("ftpsite");
  7. client.login("username", "password");
  8. client.storeFile(filename, inputStream);
  9. } catch (IOException ioe) {
  10.  
  11. ioe.printStackTrace();
  12. } finally {
  13. try {
  14.  
  15. if (inputStream!= null) {
  16. inputStream.close();
  17. }
  18.  
  19. } catch (IOException ioe) {
  20. ioe.printStackTrace();
  21. }
  22. }
  23. return null;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement