web stats
Apache Commons - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-21-2012, 08:34 AM
kt7277 kt7277 is offline
OBX.2 Kenobi
 
Join Date: Apr 2008
Location: Conway, AR
Posts: 60
kt7277
Default Apache Commons

I'm not sure how to implement Apache Commons within Mirth Connect.
When I try:
Code:
org.apache.commons.io.FileUtils.copyFile('C:/Mirth Reports/' +$('FileName'), 'C:/Mirth Test/' +$('FileName'));
I get:
Can't find method org.apache.commons.io.FileUtils.copyFile(string,st ring).

Any help would be appreciated.
Reply With Quote
  #2  
Old 06-21-2012, 09:14 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,242
cory_cole is on a distinguished road
Default

copyFile() is not a function in Apache Commons. There is a move function...

public void move(String fromName, String fromDir, String toName, String toDir)

that calls a copyFile(src, dst) that appears to be a java io function. You will either need to use the java class or call the move().
Reply With Quote
  #3  
Old 06-21-2012, 09:28 AM
dans dans is offline
Mirth Employee
 
Join Date: Apr 2007
Location: Irvine, CA
Posts: 590
dans is an unknown quantity at this point
Default

looks like copyFile is in there:
http://commons.apache.org/io/api-rel...FileUtils.html

Make sure you have Packages. before specifying the package name:
Code:
Packages.org.apache.commons.io.FileUtils.copyFile(new java.io.File('C:/Mirth Reports/' +$('FileName')), new java.io.File('C:/Mirth Test/' +$('FileName')));
__________________
Daniel Svanstedt
Software Engineer
Mirth Corporation

Want professional services, support, and enterprise or virtual appliances? It's all available from the Mirth Corporation:
Mirth Support | Mirth Training | Mirth Appliances | Online Training | Developer Q&A

Don't forget, Mirth Support gives you access to all of our online training videos, and silver support gives you access to developer Q&As!
Reply With Quote
  #4  
Old 06-21-2012, 10:11 AM
kt7277 kt7277 is offline
OBX.2 Kenobi
 
Join Date: Apr 2008
Location: Conway, AR
Posts: 60
kt7277
Thumbs up

Thanks for the help guys. That's what I needed.
Reply With Quote
  #5  
Old 10-14-2012, 12:03 PM
baumbal baumbal is offline
What's HL7?
 
Join Date: Oct 2012
Posts: 1
baumbal is on a distinguished road
Default

Hello

I'm just starting use Mirth. I'm having same error as was descibed in this post. How can I impement Apache package?

Thanks (I'm using Mirth 2.2)
Reply With Quote
  #6  
Old 10-15-2012, 06:55 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

Quote:
Originally Posted by baumbal View Post
Hello

I'm just starting use Mirth. I'm having same error as was descibed in this post. How can I impement Apache package?

Thanks (I'm using Mirth 2.2)
The original issue was occurring because copyFile was being used incorrectly. Look at the API specifications; the parameters are File objects, not strings.
__________________
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
Reply

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 11:34 AM.


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