This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud and have Kyle Brown, Bobby Woolf and Joseph Yodor on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

FTP remote file parsing

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to parse remote xml file. when i check the path of the file using outDocFile.getCanonicalFile() , it is pointing to local("C:/ct-data/ald/erd/relDeletes) but the variable(outputLocation) is pointing to "/ct-data/ald/erd/relDeletes". because of this i'm getting outDocFile.exists() =null

please let me know, if i am missing anything.


here is the code:




output:


Received Reply from FTP Connection:200
Connected Success
outputfile entity-N_CCH-61874.xml
/ct-data/ald/erd/relDeletes/
File path C:\ct-data\ald\erd\relDeletes\entity-N_CCH-61874.xml



Thanks in advance
 
Marshal
Posts: 28425
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're missing a lot of things. For example, you're missing an explanation of what FTP has to do with the question. (All you do with FTP is to connect to the server; you could leave that out entirely without affecting the rest of the code.)

You are also missing an explanation of why the canonical path for that pathless file name shouldn't be on your C drive. Where else do you think it should be, and why? And why are you surprised that the file doesn't exist?
 
archana gangaiah
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually i want to parse remote xml file so I have used FTPClient. I am able to connect to the server and but it is not picking me the remote xml file. My problem is it is giving me IO exception( The system cannot find the file specified). I have checked the remote file permission also.


outputLocation points to remote loaction (/ct-data/ald/erd/relDeletes/ )
and oct points to the file remote file which I need to parse(entity-N_CCH-61874.xml).
outDocFile.getAbsolutePath() gives me C:\ct-data\ald\erd\relDeletes\entity-N_CCH-61874.xml


 
Paul Clapham
Marshal
Posts: 28425
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, yeah. A File object is a file on your local machine. If you want access to a file on the FTP server machine then you'll need to ask the FTPClient for that file.
 
archana gangaiah
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response.It is resolved.


I have used the below FTPClient method.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic