web stats
JSch Object channel.put from rawdata - Page 2 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #11  
Old 01-27-2016, 09:55 AM
tmcdevitt tmcdevitt is offline
OBX.3 Kenobi
 
Join Date: Oct 2014
Posts: 125
tmcdevitt is on a distinguished road
Default

will I just need to add importPackage(java.nio.charset.StandardCharsets); or is there something else I need? This is the error I am getting .


Function importPackage must be called with a package; had "[JavaClass java.nio.charset.StandardCharsets]" instead.
Reply With Quote
  #12  
Old 01-27-2016, 10:09 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,116
narupley is on a distinguished road
Default

When you call importPackage you need to use a package name, not the class name. So just get rid of the ".StandardCharsets" and it should work.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #13  
Old 01-27-2016, 10:19 AM
tmcdevitt tmcdevitt is offline
OBX.3 Kenobi
 
Join Date: Oct 2014
Posts: 125
tmcdevitt is on a distinguished road
Default

I added the code importPackage(java.nio.charset.StandardCharsets); but its getting and error Function importPackage must be called with a package; had "[JavaClass java.nio.charset.StandardCharsets]" instead. How do i fix this?
Reply With Quote
  #14  
Old 01-27-2016, 10:58 AM
tmcdevitt tmcdevitt is offline
OBX.3 Kenobi
 
Join Date: Oct 2014
Posts: 125
tmcdevitt is on a distinguished road
Default

When I login to the sftp server all the files are 0KB in size, am i using the correct StandardCharsets?


var stream = new ByteArrayInputStream(connectorMessage.getRawData() .getBytes(StandardCharsets.UTF_8));

channel.put(stream, $('originalFilename'));
Reply With Quote
  #15  
Old 01-27-2016, 11:19 AM
tmcdevitt tmcdevitt is offline
OBX.3 Kenobi
 
Join Date: Oct 2014
Posts: 125
tmcdevitt is on a distinguished road
Smile Java JSch library push 0KB file

I am using the Java JSch library to connect to an SFTP server and can see that the files are getting created but the content is not in the file. The files are 0 KB is size and they are going into the correct folder on the sftp server. Can it be a way I am converting the string to a stream array.


channel.cd('Public/Labs_Import'); //Folder Name Where File Will Be Dropped

var stream = new ByteArrayInputStream(connectorMessage.getRawData() .getBytes(StandardCharsets.UTF_8));

channel.put(stream, $('originalFilename'));
Reply With Quote
Reply

Tags
getrawdata(), inputstreamreader, jsch, sftp, sftp connection

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:55 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation