ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Handling Zip file in File Input Node

Post new topic  Reply to topic Goto page Previous  1, 2
 Handling Zip file in File Input Node « View previous topic :: View next topic » 
Author Message
mqjeff
PostPosted: Wed Nov 04, 2015 7:46 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Follow the appropriate and documented methods for creating a Java method that is callable from ESQL.

Your code does not appear to demonstrate that.

Otherwise, everything else being mentioned in this thread. File access from java code? Don't do that.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
chaitu
PostPosted: Mon Nov 09, 2015 10:11 am    Post subject: Reply with quote

Voyager

Joined: 15 Apr 2014
Posts: 89

Hi All,

Thanks for all.

Now am able to unzip the file.

I am just passing the parameters of the unzip class from jcn.
Like
String fileName = (String) localEnv.getFirstElementByPath("WrittenDestination/File/Name").getValue();
//String msgStr = "c:/ZipFile/TEST.zip";
String msgStr = "c:/ZipFile"+ "\\" + fileName;
String destDir = "c:/ZipFileOutDir";
GBSUtils c = new GBSUtils();
c.unzip(msgStr,destDir);

Regards.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Nov 09, 2015 10:27 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

chaitu wrote:
Hi All,

Thanks for all.

Now am able to unzip the file.

I am just passing the parameters of the unzip class from jcn.
Like
String fileName = (String) localEnv.getFirstElementByPath("WrittenDestination/File/Name").getValue();
//String msgStr = "c:/ZipFile/TEST.zip";
String msgStr = "c:/ZipFile"+ "\\" + fileName;
String destDir = "c:/ZipFileOutDir";
GBSUtils c = new GBSUtils();
c.unzip(msgStr,destDir);

Regards.


Well done for that BUT you have ignored the advice that has been given about doing FILE IO from within a JCN. What happens is c:\Zipfile\ isn't there on the production system OR that the broker user does not have access to the directory?
What happens if your flow is deployed on a non windows OS?

You can do this using in-memory structures that make it totally portable.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
chaitu
PostPosted: Mon Nov 09, 2015 9:11 pm    Post subject: Reply with quote

Voyager

Joined: 15 Apr 2014
Posts: 89

Hi All,

If the directory is not their, then the flow fails, i got it but i dont know how to use in-memory structures.
I want to know could you share any link or guide me this.

Thanks for your valuable suggestion.
Back to top
View user's profile Send private message
darioo
PostPosted: Tue Nov 10, 2015 12:57 am    Post subject: Reply with quote

Novice

Joined: 19 Mar 2009
Posts: 15

Few more things to think about.

What if there is more than one file in the zip file? Assuming that's the case, and you can handle it, what will happen if these files are placed in multiple directories in the zip file?

Unzipping isn't quite as straightforward when you go deeper into details.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Nov 10, 2015 1:07 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

chaitu wrote:
Hi All,

If the directory is not their, then the flow fails, i got it but i dont know how to use in-memory structures.
I want to know could you share any link or guide me this.

Thanks for your valuable suggestion.


Have you even googled for something like

Java unzip in memory

??????
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Handling Zip file in File Input Node
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.