• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

greater understanding of the interaction of java and ftp/ftps

 
Ranch Hand
Posts: 164
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Firstly this post is about understanding and not simply asking for a solution
I have waded through vast documents only to find myself no better off mainly those provided by apache.commons so i appeal to anyone with a greater understanding please make it easier for other to follow what to do and more importantly why
I would like to start by ask about this line of code

The parameters in the bracket are there because? And what other parameters can be passed and where do you find this out ?
In my application the file that is uploaded carries the full url how can i remove the first part for example
C:\\jpegsToMatchBooks_30_Jan_12.zip  how can i end up with just
jpegsToMatchBooks_30_Jan_12.zip   as i think the C:\\ part even thou in this case it is just the name of the file is causing some issue on the server
here is my code


please note that this is not all my own code it has been adapted for my use, that said ther was little or no comments within the original code
 
Marshal
Posts: 4491
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

peter m hayward wrote:The parameters in the bracket are there because? And what other parameters can be passed and where do you find this out ?


You didn't say which library you were using, but most likely it is Apache Commons.  The documentation for that class can be found here: org.apache.commons.net.ftp.FTPSClient
 
Ron McLeod
Marshal
Posts: 4491
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

peter m hayward wrote:In my application the file that is uploaded carries the full url how can i remove the first part for example
C:\\jpegsToMatchBooks_30_Jan_12.zip  how can i end up with just
jpegsToMatchBooks_30_Jan_12.zip   as i think the C:\\ part even thou in this case it is just the name of the file is causing some issue on the server


One way would be to create a new File object using the file path string that you have, and use the getName() method to get the last segment in the file path.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic