You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by "Loureiro, Gil" <gi...@logica.com> on 2008/08/20 19:28:03 UTC

[ftplet] Create a directory in the OnLogin event

Hi all,

 

I'm trying to create a directory if not exist in the OnLogin event. First problem is I'm not able to get session.getFileSystemView() it always returns null . To work around I've placed the code on the OnUploadStart where I can get it correctly.

My problem now is to create a directory inside the users home dir (I get the FileObject from the getCurrentDirectory()),when I try to get the dir path I get '/', so I don't see how can I create a new dir? 

 

Regards,

Cumprimentos,

Loureiro, Gil

Document Engineering Manager

Document Services

___________________________________________

 

Logica - Releasing your potential

Rua Particular da EDP (à rua cidade Goa nº11), 2685 Sacavém

Portugal

Mobile: +351 93 741 8888

Fax: +351 21 001 8251

E: gil.loureiro@logica.com <ma...@logica.com> 

http://www.logica.com/portugal <http://www.logica.com/portugal> 

 

 



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


Re: [ftplet] Create a directory in the OnLogin event

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Thu, Aug 21, 2008 at 11:38 AM, Loureiro, Gil <gi...@logica.com> wrote:
> I'm using the M2 release... will download the last trunk and build it.

Please do, I think it should ease your implementation somewhat.

> With fsView.getFileObject("mynewdir").mkdir() all works.

Great.

/niklas

RE: [ftplet] Create a directory in the OnLogin event

Posted by "Loureiro, Gil" <gi...@logica.com>.
Hi,

I'm using the M2 release... will download the last trunk and build it.

With fsView.getFileObject("mynewdir").mkdir() all works.

Thanks, regards,

Cumprimentos,
Loureiro, Gil
Document Engineering Manager
Document Services
_________________________________________
Edinfor - a LogicaCMG company
Rua Particular da EDP (à rua cidade Goa nº11), 2685 Sacavém
Portugal
M: +351 93 741 8888
E: gil.loureiro@edinfor.logicacmg.com
www.edinfor.logicacmg.com
-----Original Message-----
From: Niklas Gustavsson [mailto:niklas@protocol7.com] 
Sent: quinta-feira, 21 de Agosto de 2008 7:45
To: ftpserver-users@mina.apache.org
Subject: Re: [ftplet] Create a directory in the OnLogin event

On Wed, Aug 20, 2008 at 7:28 PM, Loureiro, Gil <gi...@logica.com> wrote:
> I'm trying to create a directory if not exist in the OnLogin event. First
> problem is I'm not able to get session.getFileSystemView() it always returns
> null . To work around I've placed the code on the OnUploadStart where I can
> get it correctly.

What version of FtpServer are you using? The reason for asking it that
I've made a significant change to how Ftplets work in trunk, but after
the M2 release.

If your using trunk, you should be able to get the file system on
onLogin(), but I'm away from Eclipse right now so I can't verify that
for you.

> My problem now is to create a directory inside the users home dir (I get the
> FileObject from the getCurrentDirectory()),when I try to get the dir path I
> get '/', so I don't see how can I create a new dir?

fsView.getFileObject("mynewdir").mkdir() should work.

/niklas


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



Re: [ftplet] Create a directory in the OnLogin event

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Wed, Aug 20, 2008 at 7:28 PM, Loureiro, Gil <gi...@logica.com> wrote:
> I'm trying to create a directory if not exist in the OnLogin event. First
> problem is I'm not able to get session.getFileSystemView() it always returns
> null . To work around I've placed the code on the OnUploadStart where I can
> get it correctly.

What version of FtpServer are you using? The reason for asking it that
I've made a significant change to how Ftplets work in trunk, but after
the M2 release.

If your using trunk, you should be able to get the file system on
onLogin(), but I'm away from Eclipse right now so I can't verify that
for you.

> My problem now is to create a directory inside the users home dir (I get the
> FileObject from the getCurrentDirectory()),when I try to get the dir path I
> get '/', so I don't see how can I create a new dir?

fsView.getFileObject("mynewdir").mkdir() should work.

/niklas