Re: FTP library.

2009-10-06 Thread Alan Grimes

> 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: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Betwixt 0.8 and XML namespace definitions

2009-10-06 Thread Nicholas W
Examining the source code of betwixt it seems to be a bug. Filed in JIRA:

https://issues.apache.org/jira/browse/BETWIXT-67






On Tue, Oct 6, 2009 at 4:29 PM, Nicholas W <4...@log1.net> wrote:

> I have the following definition for one of my classes:
>
> saved in a file OaDC.betwixt
>
> 
> 
>   http://www.openarchives.org/OAI/2.0/oai_dc/";>
> http://purl.org/dc/elements/1.1/"/>
> http://purl.org/dc/elements/1.1/"/>
> http://purl.org/dc/elements/1.1/"/>
> http://purl.org/dc/elements/1.1/"/>
> http://purl.org/dc/elements/1.1/"/>
> http://purl.org/dc/elements/1.1/"/>
>   
> 
>
> The beanwriter has  extra configuration of the NamespacePrefixMapper like
> this:
>
> prefixMapper.setPrefix("http://purl.org/dc/elements/1.1/";, "dc");
> prefixMapper.setPrefix("http://www.openarchives.org/OAI/2.0/oai_dc/";,
> "oai_dc");
>
> However the XML generated is like this:
>
> http://www.openarchives.org/OAI/2.0/oai_dc/";>
> http://purl.org/dc/elements/1.1/";>Sample
> Title
> Sample Creator
> Sample Publisher
> Sample Description
> Sample Identifier
> Sample Subject
>   
>
> This seems to be causing a problem in that the xmlns:dc definition either
> should be repeated for every dc element, or should be in the parent element.
> Could anyone please let me know If I am doing anything wrong, or if I should
> file a bug in buzilla!
>
> Thanks in advance,
> Nicholas W.
>


Re: FTP library.

2009-10-06 Thread Mark Shifman
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
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP library.

2009-10-06 Thread James Carman
On Tue, Oct 6, 2009 at 12:12 PM, 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

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: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP library.

2009-10-06 Thread Alan Grimes
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: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP library.

2009-10-06 Thread Steve Cole
OutputStream output = new FileOutputStream(localFilename);
ftpsClient.retrieveFile(remoteFilename, output);
output.close();

- Original Message - 
From: "Alan Grimes" 
To: "Commons Users List" 
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: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: FTP library.

2009-10-06 Thread James Carman
Have you tried Commons VFS?  It might be easier.

On Tue, Oct 6, 2009 at 11:52 AM, Alan Grimes  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: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



FTP library.

2009-10-06 Thread Alan Grimes
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: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Betwixt 0.8 and XML namespace definitions

2009-10-06 Thread Nicholas W
I have the following definition for one of my classes:

saved in a file OaDC.betwixt



  http://www.openarchives.org/OAI/2.0/oai_dc/";>
http://purl.org/dc/elements/1.1/"/>
http://purl.org/dc/elements/1.1/"/>
http://purl.org/dc/elements/1.1/"/>
http://purl.org/dc/elements/1.1/"/>
http://purl.org/dc/elements/1.1/"/>
http://purl.org/dc/elements/1.1/"/>
  


The beanwriter has  extra configuration of the NamespacePrefixMapper like
this:

prefixMapper.setPrefix("http://purl.org/dc/elements/1.1/";, "dc");
prefixMapper.setPrefix("http://www.openarchives.org/OAI/2.0/oai_dc/";,
"oai_dc");

However the XML generated is like this:

http://www.openarchives.org/OAI/2.0/oai_dc/";>
http://purl.org/dc/elements/1.1/";>Sample
Title
Sample Creator
Sample Publisher
Sample Description
Sample Identifier
Sample Subject
  

This seems to be causing a problem in that the xmlns:dc definition either
should be repeated for every dc element, or should be in the parent element.
Could anyone please let me know If I am doing anything wrong, or if I should
file a bug in buzilla!

Thanks in advance,
Nicholas W.


Re: Trying to get List via FTPS results in a 550 code.

2009-10-06 Thread giladgaron

Here you go:

USER #
331 Enter password
PASS #
230 User logged in
PBSZ 0
200 PBSZ=0
PROT P
200 PRIVATE data channel protection level set
SYST
215 UNIX
LIST
550 Command LIST failed

If I send the PASV command, the client hangs, and after a few minutes a get
an exception java.net.SocketException: Connection reset
Here's the output with PASV mode:

USER #
331 Enter password
PASS #
230 User logged in
PBSZ 0
200 PBSZ=0
PROT P
200 PRIVATE data channel protection level set
SYST
215 UNIX
PASV
227 Entering Passive Mode (###,###,###,###,39,22).
LIST
//client hangs and after a few minutes throws a  java.net.SocketException:
Connection reset



Steve Cole-6 wrote:
> 
> Can you provide the output from the command listener,  like this...
> 
> USER username
> 331 Password required for username
> PASS password
> 230 Logged on
> PBSZ 0
> 200 PBSZ=0
> PROT P
> 200 Protection level set to P
> SYST
> 215 UNIX emulated by FileZilla
> PASV
> 227 Entering Passive Mode (90,0,0,126,4,196)
> LIST
> 150 Connection accepted
> 226 Transfer OK
> QUIT
> 221 Goodbye
> 
> 
> - Original Message - 
> From: "giladgaron" 
> To: 
> Sent: Saturday, October 03, 2009 4:46 AM
> Subject: Re: Trying to get List via FTPS results in a 550 code.
> 
> 
>>
>> Tried that before, no effect.
>>
>>
>> Steve Cole-6 wrote:
>> >
>> > Are you executing these commands after logging in? If not, try that.
>> >
>> >   ftpsClient.execPBSZ(0);
>> >   ftpsClient.execPROT("P");
>> >
>> >
>> > - Original Message - 
>> > From: "giladgaron" 
>> > To: 
>> > Sent: Friday, October 02, 2009 4:37 PM
>> > Subject: Re: Trying to get List via FTPS results in a 550 code.
>> >
>> >
>> >>
>> >> I have only access to one folder, which is my home folder.
>> >> I've checked with PWD (that works) to verify that I'm in the right
>> >> folder,
>> > I
>> >> even CWD to that folder to verify again that I'm in the correct
>> folder.
>> >> I'm in the correct folder and I get 550 when send the LIST command. in
>> >> the
>> >> EDT FTP Pro library it works.
>> >>
>> >>
>> >> Steve Cole-6 wrote:
>> >> >
>> >> > A 550 is file not available, not found or not accessible. Are you
> able
>> > to
>> >> > get a directory list from USER_NAME's home directory using the other
>> > FTPS
>> >> > clients? Try changing the working directory, to one that's worked
> with
>> > the
>> >> > other clients, before the list command.
>> >> >
>> >> > - Original Message - 
>> >> > From: "giladgaron" 
>> >> > To: 
>> >> > Sent: Thursday, October 01, 2009 5:46 PM
>> >> > Subject: Re: Trying to get List via FTPS results in a 550 code.
>> >> >
>> >> >
>> >> >>
>> >> >> All the user settings are in order, I've double checked it.
>> >> >> I can connect, get a list and upload files to the remote FTPS site
> via
>> > a
>> >> >> desktop FTP client and another java library called EDT FTP Pro.
>> >> >> I just can't seem to get it to work with the commons-net library.
>> >> >>
>> >> >>
>> >> >>
>> >> >> Steve Cole-6 wrote:
>> >> >> >
>> >> >> > Verify USER_NAME has permission to get a list from the default
>> >> > directory.
>> >> >> >
>> >> >> > - Original Message - 
>> >> >> > From: "giladgaron" 
>> >> >> > To: 
>> >> >> > Sent: Thursday, October 01, 2009 5:25 AM
>> >> >> > Subject: Trying to get List via FTPS results in a 550 code.
>> >> >> >
>> >> >> >
>> >> >> >>
>> >> >> >> Hello,
>> >> >> >>
>> >> >> >> I'm trying to use commons-net ftps to access a remote FTP via
> TLS.
>> >> >> >> I can connect and login to the server, but when I'm trying to
> send
>> >> a
>> >> > LIST
>> >> >> >> command, I get a 550 error.
>> >> >> >>
>> >> >> >> Code:
>> >> >> >> ftpsClient = new FTPSClient();
>> >> >> >> ftpsClient.connect("IP", "2100");
>> >> >> >> ftpsClient.login("USER_NAME, "PASSWORD");
>> >> >> >> ftpsClient.list();
>> >> >> >>
>> >> >> >> Any ideas?
>> >> >> >> Thanks.
>> >> >> >> -- 
>> >> >> >> View this message in context:
>> >> >> >
>> >> >
>> >
> http://www.nabble.com/Trying-to-get-List-via-FTPS-results-in-a-550-code.-tp25695525p25695525.html
>> >> >> >> Sent from the Commons - User mailing list archive at Nabble.com.
>> >> >> >>
>> >> >> >>
>> >> >>
>> >>> -
>> >> >> >> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> >> >> >> For additional commands, e-mail: user-h...@commons.apache.org
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> -
>> >> >> > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> >> >> > For additional commands, e-mail: user-h...@commons.apache.org
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> -- 
>> >> >> View this message in context:
>> >> >
>> >
> http://www.nabble.com/Trying-to-get-List-via-FTPS-results-in-a-550-code.-tp25695525p25707068.html
>> >> >> Sent from the Commons - User mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >>
>>> ---