FTP library.

11 messages Options
Embed this post
Permalink
Alan Grimes-2

FTP library.

Reply Threaded More More options
Print post
Permalink
I've been trying to grok the NET/FTP library for several hours now and
I've only met with frustration so far. It's really quite remarkable how
well the documentation explains how to do practically anything under the
sun to a FTP archive *EXCEPT DOWNLOAD A FILE*. That's right, I can't
figure out how one is supposed to download a file. I can't find any
methods such as "getObjectBits" or "downloadFileText", or any examples
that involve downloading a file. There are no objects such as
FTPDataStream. FTPFile seems to be useless for anything other than
accessing file attributes. This is certainly a major documentation if
not design problem!!! =(


--
New president: Here we go again...
Chemistry.com: A total rip-off.
Powers are not rights.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

James Carman

Re: FTP library.

Reply Threaded More More options
Print post
Permalink
Have you tried Commons VFS?  It might be easier.

On Tue, Oct 6, 2009 at 11:52 AM, Alan Grimes <[hidden email]> wrote:

> I've been trying to grok the NET/FTP library for several hours now and
> I've only met with frustration so far. It's really quite remarkable how
> well the documentation explains how to do practically anything under the
> sun to a FTP archive *EXCEPT DOWNLOAD A FILE*. That's right, I can't
> figure out how one is supposed to download a file. I can't find any
> methods such as "getObjectBits" or "downloadFileText", or any examples
> that involve downloading a file. There are no objects such as
> FTPDataStream. FTPFile seems to be useless for anything other than
> accessing file attributes. This is certainly a major documentation if
> not design problem!!! =(
>
>
> --
> New president: Here we go again...
> Chemistry.com: A total rip-off.
> Powers are not rights.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Alan Grimes-2

Re: FTP library.

Reply Threaded More More options
Print post
Permalink
James Carman wrote:
> Have you tried Commons VFS?  It might be easier.

No, I'm basically groping in the dark. I put ftp into google, and
net/ftp appears to be the most high-profile project from the apache
foundation which appears to have the most mature set of Java libraries
available.

I feel like I'm the victim of a practical joke where you name one
package with exactly the terms I would type into google, and then make a
different package that is actually useful. =P

--
New president: Here we go again...
Chemistry.com: A total rip-off.
Powers are not rights.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Steve Cole-6

Re: FTP library.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Alan Grimes-2
    OutputStream output = new FileOutputStream(localFilename);
    ftpsClient.retrieveFile(remoteFilename, output);
    output.close();

----- Original Message -----
From: "Alan Grimes" <[hidden email]>
To: "Commons Users List" <[hidden email]>
Sent: Tuesday, October 06, 2009 11:52 AM
Subject: FTP library.


> I've been trying to grok the NET/FTP library for several hours now and
> I've only met with frustration so far. It's really quite remarkable how
> well the documentation explains how to do practically anything under the
> sun to a FTP archive *EXCEPT DOWNLOAD A FILE*. That's right, I can't
> figure out how one is supposed to download a file. I can't find any
> methods such as "getObjectBits" or "downloadFileText", or any examples
> that involve downloading a file. There are no objects such as
> FTPDataStream. FTPFile seems to be useless for anything other than
> accessing file attributes. This is certainly a major documentation if
> not design problem!!! =(
>
>
> --
> New president: Here we go again...
> Chemistry.com: A total rip-off.
> Powers are not rights.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

James Carman

Re: FTP library.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Alan Grimes-2
On Tue, Oct 6, 2009 at 12:12 PM, Alan Grimes <[hidden email]> wrote:

> James Carman wrote:
>> Have you tried Commons VFS?  It might be easier.
>
> No, I'm basically groping in the dark. I put ftp into google, and
> net/ftp appears to be the most high-profile project from the apache
> foundation which appears to have the most mature set of Java libraries
> available.
>
> I feel like I'm the victim of a practical joke where you name one
> package with exactly the terms I would type into google, and then make a
> different package that is actually useful. =P

Heh, too funny.  Commons Net will do what you want, but it's meant to
be a lower-level API, more closely tied to the protocols themselves.
Commons VFS builds a file system abstraction on top of all kinds of
protocols (local files, ftp, http, etc.).  To me, it's easier to get
that up and running and if I ever want to change it in the future to a
different technology, I can without changing my client code, since
it's using the abstraction.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Mark Shifman

Re: FTP library.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Alan Grimes-2
I know this is a commons user list but ...
edtftp library works well. There is a free version and it does the things you know about
with ftp ie get, and put.

If you need to use streams, you can do that too.

http://www.enterprisedt.com/products/edtftpj/

mas

Alan Grimes wrote:

> James Carman wrote:
>> Have you tried Commons VFS?  It might be easier.
>
> No, I'm basically groping in the dark. I put ftp into google, and
> net/ftp appears to be the most high-profile project from the apache
> foundation which appears to have the most mature set of Java libraries
> available.
>
> I feel like I'm the victim of a practical joke where you name one
> package with exactly the terms I would type into google, and then make a
> different package that is actually useful. =P
>

--
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Alan Grimes-2

Re: FTP library.

Reply Threaded More More options
Print post
Permalink
In reply to this post by James Carman

> Heh, too funny.  Commons Net will do what you want, but it's meant to
> be a lower-level API, more closely tied to the protocols themselves.
> Commons VFS builds a file system abstraction on top of all kinds of
> protocols (local files, ftp, http, etc.).  To me, it's easier to get
> that up and running and if I ever want to change it in the future to a
> different technology, I can without changing my client code, since
> it's using the abstraction.

Yes, it looks that way.

My problem involves finding and retrieving files from a FTP archive
which may or may not be on the same host I'm running my program on.
(hence the flexibility to switch between files and FTP objects is
important to me.)

Ideally, I'd be able to treat these as strings or something and pass
them directly into a CSV library to extract records... I'll pipe up
again if I have further issues.


--
New president: Here we go again...
Chemistry.com: A total rip-off.
Powers are not rights.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Alan Grimes-2

Inherent problem with Java classes.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Mark Shifman
There's an inherent problem with all classes and class packages of all
languages. Basically when you package up a bundle of classes there are
few clues for a novice to determine which classes are for internal use
only and which are the primary front end of the API. Similarly, when
there are dozens of non-depreciated methods in a class, it becomes
difficult for a novice to determine which are the critical calls that
every application will inevitably use and which are there just to handle
corner cases or special applications. This is why I had trouble finding
the call for dowloading a file in the FTP system.

Javadoc is wonderful. It certainly does help when one needs a
refference. The VFS package seems to be closer to what I actually need,
but at the same time it's much more complex. This is why HowTos and
other tutorials are vitally important for all non-trivial packages,
especially packages for use as libraries. =(

Do you know where I can find useful getting started guides for VFS?


--
New president: Here we go again...
Chemistry.com: A total rip-off.
Powers are not rights.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

James Carman

Re: Inherent problem with Java classes.

Reply Threaded More More options
Print post
Permalink
This should get you started:

http://commons.apache.org/vfs/api.html

You'll want to make sure you've got everything you need on the
classpath so that all of the file system types you need are enabled.

On Wed, Oct 7, 2009 at 1:53 PM, Alan Grimes <[hidden email]> wrote:

> There's an inherent problem with all classes and class packages of all
> languages. Basically when you package up a bundle of classes there are
> few clues for a novice to determine which classes are for internal use
> only and which are the primary front end of the API. Similarly, when
> there are dozens of non-depreciated methods in a class, it becomes
> difficult for a novice to determine which are the critical calls that
> every application will inevitably use and which are there just to handle
> corner cases or special applications. This is why I had trouble finding
> the call for dowloading a file in the FTP system.
>
> Javadoc is wonderful. It certainly does help when one needs a
> refference. The VFS package seems to be closer to what I actually need,
> but at the same time it's much more complex. This is why HowTos and
> other tutorials are vitally important for all non-trivial packages,
> especially packages for use as libraries. =(
>
> Do you know where I can find useful getting started guides for VFS?
>
>
> --
> New president: Here we go again...
> Chemistry.com: A total rip-off.
> Powers are not rights.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Alan Grimes-2

Re: Inherent problem with Java classes.

Reply Threaded More More options
Print post
Permalink
James Carman wrote:
> This should get you started:
>
> http://commons.apache.org/vfs/api.html
>
> You'll want to make sure you've got everything you need on the
> classpath so that all of the file system types you need are enabled.

Thanks much, I guess i have trouble finding things in lengthy lists of
stuff. (also, I've been wasting too much time on my C++ project,
ktechlab, hacking on that thing is crack. =P )

--
New president: Here we go again...
Chemistry.com: A total rip-off.
Powers are not rights.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

James Carman

Re: Inherent problem with Java classes.

Reply Threaded More More options
Print post
Permalink
Basically, if you just want to use FTP for now, you need to have
Commons Net (yes the one you tried to use :) on the classpath:

http://commons.apache.org/vfs/download.html

You'll also need Commons Logging and some logging provider (log4j, jdk
logging, etc.).

On Wed, Oct 7, 2009 at 2:20 PM, Alan Grimes <[hidden email]> wrote:

> James Carman wrote:
>> This should get you started:
>>
>> http://commons.apache.org/vfs/api.html
>>
>> You'll want to make sure you've got everything you need on the
>> classpath so that all of the file system types you need are enabled.
>
> Thanks much, I guess i have trouble finding things in lengthy lists of
> stuff. (also, I've been wasting too much time on my C++ project,
> ktechlab, hacking on that thing is crack. =P )
>
> --
> New president: Here we go again...
> Chemistry.com: A total rip-off.
> Powers are not rights.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]