Creating Custom Component information can be found here:
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.