You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Tony Cooke <To...@elders.com.au> on 2006/11/29 06:41:06 UTC

[NET] FTP client object lifespan

OK. This is probably a dumb question but I'll ask anyway.

 

What is the lifespan of an FTPClient object?

OR.... Do I need to recreate the configuration information each time I
connect and disconnect?

 

What I plan on doing is making an application that periodically monitors
for any file changes on an ftp server. (VFS is supposed to do this but
currently doesn't. I've had a bug logged for a while now but I got tired
of waiting)

 

What I want to do is set up the configuration information (system type,
IP address / Host name, user ID, password, etc) for the FTPClient and
use this with my monitor, connecting, checking the file for lastModified
time and then disconnecting. This will be done every few hours or so.

 

I don't particularly want to have to set up the config information each
time as I'm trying to make the monitor as generic as possible to monitor
multiple ftp locations, with differing configurations. (Basically I want
to call the monitor with an FTPClient objects and it will monitor a file
specified for each object)

 

I know that the disconnect resets the configuration to default but I'm
wondering if there's any way to have an FTPClient object that retains it
all so I just need to connect, check the files and disconnect.

 

Thanks in advance for any help.

 

All the best,

Tony


RE: [NET] FTP client object lifespan

Posted by Tony Cooke <To...@elders.com.au>.
Hi again Rory.

Yes, I could, and probably will.

I was just hoping that there was an easy way (read: built in) to keep
state of the FTPClient connection so that an automated process wouldn't
need to have that information re-entered.

I was just being lazy.

Thanks for your help Rory. It is greatly appreciated.

All the best,
Tony

> -----Original Message-----
> From: Rory Winston [mailto:rwinston@eircom.net]
> Sent: Friday, 1 December 2006 9:23 AM
> To: Jakarta Commons Users List
> Subject: Re: [NET] FTP client object lifespan
> 
> Tony
> 
> It wouldnt be too difficult to subclass or wrap FTPClient and keep
> whatever state you need in the wrapper or subclass object. This could
be
> an easy way to do what you need to do.
> 
> Cheers
> Rory
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 



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


Re: [NET] FTP client object lifespan

Posted by Rory Winston <rw...@eircom.net>.
Tony

It wouldnt be too difficult to subclass or wrap FTPClient and keep 
whatever state you need in the wrapper or subclass object. This could be 
an easy way to do what you need to do.

Cheers
Rory


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


RE: [NET] FTP client object lifespan

Posted by Tony Cooke <To...@elders.com.au>.
Hi Rory.

That's what I was afraid of.

Thanks anyway.

All the best,
Tony

> -----Original Message-----
> From: Rory Winston [mailto:rwinston@eircom.net]
> Sent: Friday, 1 December 2006 6:17 AM
> To: Jakarta Commons Users List
> Subject: Re: [NET] FTP client object lifespan
> 
> Tony
> 
> You'll need to provide this info on reconnect.
> 
> Thanks
> Rory
> Tony Cooke wrote:
> > Hi Rory.
> >
> > Basically I'm talking about everything needed to connect to a
server.
> >
> > - login/password information
> > - host / IP address of server
> > - passive / active connection information
> > - system type
> > - timezone, etc
> > - basically everything to do with setting up a connection to a
server
> >
> > That way you can connect and disconnect from the server just by
calling
> > connect() or disconnect() without having to set up the FTPClient
every
> > time.
> >
> > The file monitor program I'm writing (with regards to FTP) requires
that
> > I pass through an object and the filename to monitor, but this could
be
> > multiple FTP locations with files for each location.
> >
> > With the FTPClient as it stands I would need to set up the
connection
> > each time I connected because the disconnect would reset everything
back
> > to defaults.
> >
> > I hope that explains it better.
> >
> > All the best,
> > Tony
> >
> >
> >> -----Original Message-----
> >> From: Rory Winston [mailto:rwinston@eircom.net]
> >> Sent: Thursday, 30 November 2006 9:18 AM
> >> To: Jakarta Commons Users List
> >> Subject: Re: [NET] FTP client object lifespan
> >>
> >> Tony
> >>
> >> Not really sure I understand the question - what configuration
> >> information are you talking about?
> >>
> >> Rory
> >>
> >> Tony Cooke wrote:
> >>
> >>> OK. This is probably a dumb question but I'll ask anyway.
> >>>
> >>>
> >>>
> >>> What is the lifespan of an FTPClient object?
> >>>
> >>> OR.... Do I need to recreate the configuration information each
time
> >>>
> > I
> >
> >>> connect and disconnect?
> >>>
> >>>
> >>>
> >>> What I plan on doing is making an application that periodically
> >>>
> > monitors
> >
> >>> for any file changes on an ftp server. (VFS is supposed to do this
> >>>
> > but
> >
> >>> currently doesn't. I've had a bug logged for a while now but I got
> >>>
> > tired
> >
> >>> of waiting)
> >>>
> >>>
> >>>
> >>> What I want to do is set up the configuration information (system
> >>>
> > type,
> >
> >>> IP address / Host name, user ID, password, etc) for the FTPClient
> >>>
> > and
> >
> >>> use this with my monitor, connecting, checking the file for
> >>>
> > lastModified
> >
> >>> time and then disconnecting. This will be done every few hours or
> >>>
> > so.
> >
> >>>
> >>> I don't particularly want to have to set up the config information
> >>>
> > each
> >
> >>> time as I'm trying to make the monitor as generic as possible to
> >>>
> > monitor
> >
> >>> multiple ftp locations, with differing configurations. (Basically
I
> >>>
> > want
> >
> >>> to call the monitor with an FTPClient objects and it will monitor
a
> >>>
> > file
> >
> >>> specified for each object)
> >>>
> >>>
> >>>
> >>> I know that the disconnect resets the configuration to default but
> >>>
> > I'm
> >
> >>> wondering if there's any way to have an FTPClient object that
> >>>
> > retains it
> >
> >>> all so I just need to connect, check the files and disconnect.
> >>>
> >>>
> >>>
> >>> Thanks in advance for any help.
> >>>
> >>>
> >>>
> >>> All the best,
> >>>
> >>> Tony
> >>>
> >>>
> >>>
> >>>
> >>
> >>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
commons-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
commons-user-help@jakarta.apache.org
> >
> >
> >
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 



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


Re: [NET] FTP client object lifespan

Posted by Rory Winston <rw...@eircom.net>.
Tony

You'll need to provide this info on reconnect.

Thanks
Rory
Tony Cooke wrote:
> Hi Rory.
>
> Basically I'm talking about everything needed to connect to a server.
>
> - login/password information
> - host / IP address of server
> - passive / active connection information
> - system type
> - timezone, etc
> - basically everything to do with setting up a connection to a server
>
> That way you can connect and disconnect from the server just by calling
> connect() or disconnect() without having to set up the FTPClient every
> time.
>
> The file monitor program I'm writing (with regards to FTP) requires that
> I pass through an object and the filename to monitor, but this could be
> multiple FTP locations with files for each location.
>
> With the FTPClient as it stands I would need to set up the connection
> each time I connected because the disconnect would reset everything back
> to defaults.
>
> I hope that explains it better.
>
> All the best,
> Tony
>
>   
>> -----Original Message-----
>> From: Rory Winston [mailto:rwinston@eircom.net]
>> Sent: Thursday, 30 November 2006 9:18 AM
>> To: Jakarta Commons Users List
>> Subject: Re: [NET] FTP client object lifespan
>>
>> Tony
>>
>> Not really sure I understand the question - what configuration
>> information are you talking about?
>>
>> Rory
>>
>> Tony Cooke wrote:
>>     
>>> OK. This is probably a dumb question but I'll ask anyway.
>>>
>>>
>>>
>>> What is the lifespan of an FTPClient object?
>>>
>>> OR.... Do I need to recreate the configuration information each time
>>>       
> I
>   
>>> connect and disconnect?
>>>
>>>
>>>
>>> What I plan on doing is making an application that periodically
>>>       
> monitors
>   
>>> for any file changes on an ftp server. (VFS is supposed to do this
>>>       
> but
>   
>>> currently doesn't. I've had a bug logged for a while now but I got
>>>       
> tired
>   
>>> of waiting)
>>>
>>>
>>>
>>> What I want to do is set up the configuration information (system
>>>       
> type,
>   
>>> IP address / Host name, user ID, password, etc) for the FTPClient
>>>       
> and
>   
>>> use this with my monitor, connecting, checking the file for
>>>       
> lastModified
>   
>>> time and then disconnecting. This will be done every few hours or
>>>       
> so.
>   
>>>
>>> I don't particularly want to have to set up the config information
>>>       
> each
>   
>>> time as I'm trying to make the monitor as generic as possible to
>>>       
> monitor
>   
>>> multiple ftp locations, with differing configurations. (Basically I
>>>       
> want
>   
>>> to call the monitor with an FTPClient objects and it will monitor a
>>>       
> file
>   
>>> specified for each object)
>>>
>>>
>>>
>>> I know that the disconnect resets the configuration to default but
>>>       
> I'm
>   
>>> wondering if there's any way to have an FTPClient object that
>>>       
> retains it
>   
>>> all so I just need to connect, check the files and disconnect.
>>>
>>>
>>>
>>> Thanks in advance for any help.
>>>
>>>
>>>
>>> All the best,
>>>
>>> Tony
>>>
>>>
>>>
>>>       
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>     
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
>
>   



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


RE: [NET] FTP client object lifespan

Posted by Tony Cooke <To...@elders.com.au>.
Hi Rory.

Basically I'm talking about everything needed to connect to a server.

- login/password information
- host / IP address of server
- passive / active connection information
- system type
- timezone, etc
- basically everything to do with setting up a connection to a server

That way you can connect and disconnect from the server just by calling
connect() or disconnect() without having to set up the FTPClient every
time.

The file monitor program I'm writing (with regards to FTP) requires that
I pass through an object and the filename to monitor, but this could be
multiple FTP locations with files for each location.

With the FTPClient as it stands I would need to set up the connection
each time I connected because the disconnect would reset everything back
to defaults.

I hope that explains it better.

All the best,
Tony

> -----Original Message-----
> From: Rory Winston [mailto:rwinston@eircom.net]
> Sent: Thursday, 30 November 2006 9:18 AM
> To: Jakarta Commons Users List
> Subject: Re: [NET] FTP client object lifespan
> 
> Tony
> 
> Not really sure I understand the question - what configuration
> information are you talking about?
> 
> Rory
> 
> Tony Cooke wrote:
> > OK. This is probably a dumb question but I'll ask anyway.
> >
> >
> >
> > What is the lifespan of an FTPClient object?
> >
> > OR.... Do I need to recreate the configuration information each time
I
> > connect and disconnect?
> >
> >
> >
> > What I plan on doing is making an application that periodically
monitors
> > for any file changes on an ftp server. (VFS is supposed to do this
but
> > currently doesn't. I've had a bug logged for a while now but I got
tired
> > of waiting)
> >
> >
> >
> > What I want to do is set up the configuration information (system
type,
> > IP address / Host name, user ID, password, etc) for the FTPClient
and
> > use this with my monitor, connecting, checking the file for
lastModified
> > time and then disconnecting. This will be done every few hours or
so.
> >
> >
> >
> > I don't particularly want to have to set up the config information
each
> > time as I'm trying to make the monitor as generic as possible to
monitor
> > multiple ftp locations, with differing configurations. (Basically I
want
> > to call the monitor with an FTPClient objects and it will monitor a
file
> > specified for each object)
> >
> >
> >
> > I know that the disconnect resets the configuration to default but
I'm
> > wondering if there's any way to have an FTPClient object that
retains it
> > all so I just need to connect, check the files and disconnect.
> >
> >
> >
> > Thanks in advance for any help.
> >
> >
> >
> > All the best,
> >
> > Tony
> >
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 



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


Re: [NET] FTP client object lifespan

Posted by Rory Winston <rw...@eircom.net>.
Tony

Not really sure I understand the question - what configuration 
information are you talking about?

Rory

Tony Cooke wrote:
> OK. This is probably a dumb question but I'll ask anyway.
>
>  
>
> What is the lifespan of an FTPClient object?
>
> OR.... Do I need to recreate the configuration information each time I
> connect and disconnect?
>
>  
>
> What I plan on doing is making an application that periodically monitors
> for any file changes on an ftp server. (VFS is supposed to do this but
> currently doesn't. I've had a bug logged for a while now but I got tired
> of waiting)
>
>  
>
> What I want to do is set up the configuration information (system type,
> IP address / Host name, user ID, password, etc) for the FTPClient and
> use this with my monitor, connecting, checking the file for lastModified
> time and then disconnecting. This will be done every few hours or so.
>
>  
>
> I don't particularly want to have to set up the config information each
> time as I'm trying to make the monitor as generic as possible to monitor
> multiple ftp locations, with differing configurations. (Basically I want
> to call the monitor with an FTPClient objects and it will monitor a file
> specified for each object)
>
>  
>
> I know that the disconnect resets the configuration to default but I'm
> wondering if there's any way to have an FTPClient object that retains it
> all so I just need to connect, check the files and disconnect.
>
>  
>
> Thanks in advance for any help.
>
>  
>
> All the best,
>
> Tony
>
>
>   



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