Zip file reading

Hi ,
Is there any way to connect to FTP server, read the war,zip files.
I am using UniversalDataReader component red teh zip file but not able to connect to the FTP server. if we are reading Zip file what should be the metadata.
Can anybody provide me the examples?

Thanks in advance

Hello,
following should work:

zip:(ftp://user:password@server/my_file.zip)#*

The metadata represents the structure of data (as after in unzipped files).

Hi Thanks a lot for your immediate reply but i am still having problem …and please let me know what metadata we have provide in order to move the zip file from one server to another server.

I am reading zip file connect to some remote server using this url ftp://username:password@server in server tab of URL file dialog box of cloverDatareader component. zip:(/opt/pipeline/webapps/pocportlet.zip)#* in path location of the same.
but i am getting the error like below

INFO [main] - register MBean with name:org.jetel.graph.runtime:type=CLOVERJMX_1261475718958_0
INFO [WatchDog] - [Clover] Initializing phase: 0
DEBUG [WatchDog] - initializing edges:
DEBUG [WatchDog] - all edges initialized successfully…
DEBUG [WatchDog] - initializing nodes:
ERROR [WatchDog] - Phase initialization failed with reason: CLOVER_READER0 …FAILED !
Reason: java.net.UnknownHostException: tfight@slctests14g.sct.com
CLOVER_READER0 …FAILED !
Reason: java.net.UnknownHostException: tfight@slctests14g.sct.com
at org.jetel.graph.Phase.init(Phase.java:159)
at org.jetel.graph.runtime.WatchDog.executePhase(WatchDog.java:447)
at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:184)
at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:62)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: tfight@slctests14g.sct.com
at org.jetel.component.CloverDataReader.initFileIterator(CloverDataReader.java:306)
at org.jetel.component.CloverDataReader.init(CloverDataReader.java:266)
at org.jetel.graph.Phase.init(Phase.java:154)
… 6 more
Caused by: java.net.UnknownHostException: tfight@slctests14g.sct.com
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.NetworkClient.openServer(Unknown Source)
at sun.net.ftp.FtpClient.openServer(Unknown Source)
at sun.net.ftp.FtpClient.openServer(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Source)
at org.jetel.util.file.WcardPattern.innerFileNames(WcardPattern.java:218)
at org.jetel.util.file.WcardPattern.innerFileNames(WcardPattern.java:183)
at org.jetel.util.file.WcardPattern.filenames(WcardPattern.java:155)
at org.jetel.component.CloverDataReader.initFileIterator(CloverDataReader.java:304)
… 8 more
ERROR [WatchDog] - !!! Phase finished with error - stopping graph run !!!
INFO [WatchDog] - ----------------------** Final tracking Log for phase [0] **---------------------
INFO [WatchDog] - Time: 03/02/10 16:10:40
INFO [WatchDog] - Node Status Port #Records #KB aRec/s aKB/s
INFO [WatchDog] - ---------------------------------------------------------------------------------
INFO [WatchDog] - CLOVER_READER0 ERROR
INFO [WatchDog] - %cpu:… Out:0 0 0 0 0
INFO [WatchDog] - CLOVER_WRITER0 N/A
INFO [WatchDog] - %cpu:… In:0 0 0 0 0
INFO [WatchDog] - ---------------------------------** End of Log **--------------------------------
INFO [WatchDog] - Execution of phase [0] finished with error - elapsed time(sec): 0
INFO [WatchDog] - -----------------------** Summary of Phases execution **---------------------
INFO [WatchDog] - Phase# Finished Status RunTime(sec) MemoryAllocation(KB)
INFO [WatchDog] - 0 ERROR 0 1434
INFO [WatchDog] - ------------------------------** End of Summary **---------------------------
INFO [WatchDog] - WatchDog thread finished - total execution time: 5 (sec)
INFO [main] - Freeing graph resources.
ERROR [main] - Execution of graph failed !

will you please help me in this i am really stuck with this in my hectic project

Hello,
your file url should look like follows:

zip:(ftp://tfight:@slctests14g.sct.com/opt/pipeline/webapps/pocportlet.zip)#*

But if you want only move files from one location to another it is not good idea to do it with Data Reader. You should do it outside the Clover and use CloverETL for data transformation. If copying of the files is part of your transformation, use rather SystemExecute instead of Data Reader.

Hi avackova,
Thanks for reply , But my requirement is the Tomcat migration using the clover ETL,
I have to connect to the some server and copy the zip file , move to the another server.
So have planned to use the Universal data reader by providing the connection details for FTP server
like the example showed in the clover ETL site.
Syntax of the ftp url ftp://user:password@server/path/name.txt then i have given as ftp://cpadmin:c@tfight@slctests14g.sct.com but it is accepting the tfight@slctests14g.sct.com
Please help me how to give the username and password for that server to connect.

i am providing the full graph code below , here i am trying user Clover data reader

<?xml version="1.0" encoding="UTF-8"?>

thanks a lot for all your help

Hello rishabandari,

java.net.UnknownHostException: tfight@slctests14g.sct.com

means that your computer doesn’t know the tfight@slctests14g.sct.com host. Check the host name and try to connect to the host from a ftp client. If it works, connection from CloverETL should also work.

Clover Data Reader is used for reading files saved in internal Clover format. You should use one of the flat file readers (Universal Data Reader, Delimited Data Reader or Fix length Data Reader).

yaha i am able to ping and take the files from that ftp server.
yha if i am using universal reader also it is giving the same problem.

see my host name is slctest14s.sct.com
and username is user1
password is password
Please let me know how to connect in FTP location
if iam using the ftp://cpadmin:c@tfight@slctests14g.sct.com then it is ignoring the cpadmin:c@ till here and taking the
tfight@slctests14g.sct.com and not able to connect
Please provide me the solution

thanks

Oh, I see - you have @ character in your password. I’m afraid it is not possible to read the file by CloverETL in such case. You have to get the file outside the Clover and just then read it by Universal Data Reader from local location.
I’ve created a bug report (http://bug.cloveretl.com/view.php?id=3706) in our bug tracking system.

Hi ,
If try without @symbol in the password also it is not connect.I have tried with FTP,HTTP,HTTPS,SFTP.
I am getting the following screen only(Please see the attach)

Hello,

Auth fail

means that your credentials are invalid. Are you able to connect to the server from command line with the credentials used in Clover? Maybe try to configure proxy settings.

Hi ,
I am able to connect to the same server using FTP… but not able to connect via ftp connection in the clover.
One thing is i am trying to connect to the server which is in SaltLakeCity.(I am trying in india). we will use the VPN to connect that Server.
Is this the problem that it is not able to connect.
Please help me.

Thanks
risha

Can you send the whole stack trace, that part of is visible in the picture?

Hi,

if you plan to use any URL “invalid” characters like @, you need to escape/URL encode them. For example @test becomes %40test.
You may try on-line escaping like this one: http://www.hypergurl.com/urlencode.html