Creating Custom Component information can be found here:
Adobe LiveCycle * Creating Your First Component
As far as SFTP goes, I would suggest creating a project in Eclipse, and get the Java SFTP code working outside of LiveCycle.
Once you are confident that your code is running right, then make the conversion into a Component - that will isolate Component issues from SFTP issues.
In the past I have found Java SFTP routines to use as 'seed' code on the internet. Used Eclipse to make them into what I need, then convert to LC.
Good Luck!
Mark