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 Kenneth Vanvik Hansen <kv...@online.no> on 2010/03/17 14:39:04 UTC

LIST from database

Hi, i have written an ftplet that puts a file and file info in a database
table. Now I need to get LIST to list information from the database. I was
wondering if something like this has been done before? Would save me some
time if someone had any solutions/ideas.

 

Kenneth


RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
Thanks, I think I figured out how to do it. This kind of works, but I was
wondering if anyone knows a good format for the ftp LIST reply?


	public FtpletResult beforeCommand(FtpSession session, FtpRequest
request) throws FtpException, IOException
	{
		if(request.getCommand().equals("LIST"))
		{
			try
			{
				session.write(new DefaultFtpReply(150,
"Getting data connection."));	
				DataConnection dataConnection =
session.getDataConnection().openConnection();
				dataConnection.transferToClient(session,
"Insert LIST output here");
				session.write(new DefaultFtpReply(226,
"Transfer Complete."));
	
session.getDataConnection().closeDataConnection();
				return FtpletResult.SKIP;
			}
			catch(Exception ex)
			{
				session.write(new DefaultFtpReply(551, "Data
transfer failed."));
			}
		}
		
		return null;
	}

-----Original Message-----
From: Janardhanan, Ajith (AJANARDH) [mailto:AJANARDH@arinc.com] 
Sent: 17. mars 2010 14:55
To: ftpserver-users@mina.apache.org
Subject: RE: LIST from database

Kenneth,
I had done something similar(connecting to MQ, getting a bunch of queue info
and displaying to the user as a dir structure).But the ftpserver codebase I
used was 2+ years old. So really don't know if this will still hold good.
This is what I did:

  - Modified the execute() method in LIST.java file by adding
ftpletContainer.onLIST()
  - Override onLIST() on my ftplet to have 

I did something line this in LIST.java:


public void execute(Connection connection,
                        FtpRequest request, 
                        FtpSessionImpl session, 
                        FtpReplyOutput out) throws IOException, FtpException
{
        
        try {
	
            // reset state variables
            session.resetState();
            FtpServerContext serverContext = connection.getServerContext();
            Ftplet ftpletContainer = serverContext.getFtpletContainer();
            FtpletEnum ftpletRet;
            
            
            try{
                ftpletRet = ftpletContainer.onLIST(session, request, out);
            } catch(Exception e) {
                LOG.debug("Ftplet container threw exception", e);
                ftpletRet = FtpletEnum.RET_DISCONNECT;
            }
            if(ftpletRet == FtpletEnum.RET_SKIP) {
               return;
            }else
              if(ftpletRet == FtpletEnum.RET_DISCONNECT) {
 
serverContext.getConnectionManager().closeConnection(connection);
                return;
            }
}





Good Luck!

Ajith



-----Original Message-----
From: Kenneth Vanvik Hansen [mailto:kvhansen@online.no]
Sent: Wednesday, March 17, 2010 9:39 AM
To: ftpserver-users@mina.apache.org
Subject: LIST from database

Hi, i have written an ftplet that puts a file and file info in a database
table. Now I need to get LIST to list information from the database. I was
wondering if something like this has been done before?
Would save me some time if someone had any solutions/ideas.

 

Kenneth



RE: LIST from database

Posted by "Janardhanan, Ajith (AJANARDH)" <AJ...@arinc.com>.
Kenneth,
I had done something similar(connecting to MQ, getting a bunch of queue
info and displaying to the user as a dir structure).But the ftpserver
codebase I used was 2+ years old. So really don't know if this will
still hold good. This is what I did:

  - Modified the execute() method in LIST.java file by adding
ftpletContainer.onLIST()
  - Override onLIST() on my ftplet to have 

I did something line this in LIST.java:


public void execute(Connection connection,
                        FtpRequest request, 
                        FtpSessionImpl session, 
                        FtpReplyOutput out) throws IOException,
FtpException {
        
        try {
	
            // reset state variables
            session.resetState();
            FtpServerContext serverContext =
connection.getServerContext();
            Ftplet ftpletContainer = serverContext.getFtpletContainer();
            FtpletEnum ftpletRet;
            
            
            try{
                ftpletRet = ftpletContainer.onLIST(session, request,
out);
            } catch(Exception e) {
                LOG.debug("Ftplet container threw exception", e);
                ftpletRet = FtpletEnum.RET_DISCONNECT;
            }
            if(ftpletRet == FtpletEnum.RET_SKIP) {
               return;
            }else
              if(ftpletRet == FtpletEnum.RET_DISCONNECT) {
 
serverContext.getConnectionManager().closeConnection(connection);
                return;
            }
}





Good Luck!

Ajith



-----Original Message-----
From: Kenneth Vanvik Hansen [mailto:kvhansen@online.no] 
Sent: Wednesday, March 17, 2010 9:39 AM
To: ftpserver-users@mina.apache.org
Subject: LIST from database

Hi, i have written an ftplet that puts a file and file info in a
database table. Now I need to get LIST to list information from the
database. I was wondering if something like this has been done before?
Would save me some time if someone had any solutions/ideas.

 

Kenneth


Re: LIST from database

Posted by Robin Windels <ro...@gmail.com>.
i am also interested

/Robin


On Fri, Mar 19, 2010 at 9:23 AM, Kenneth Vanvik Hansen
<kv...@online.no>wrote:

> Not using JPA at the moment, but i probably could if i wanted to. If you
> could send me the files it might save me a lot of work. Using an Oracle
> database, but I could probably make the required changes myself. Thanks.
>
> Kenneth
>
> kvhansen@online.no
>
> -----Original Message-----
> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]
> Sent: 19. mars 2010 16:42
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
>
> Kenneth are you using JPA or can use JPA?  I have this implemented in JPA
> and I could send you the files but they are not clean in that they
> reference
> tables in my database, etc.  From the files, you could extract what you
> need, however.  Or probably by Monday, I could have this cleaned up enough
> to submit back.
>
> Files are stored in the DB as blobs and I have directory/subdirectory,
> list,
> put, get, and delete all working using Derby as my target database.
>
> Kenneth Vanvik Hansen wrote:
> > Thanks, got it running. Now i'm trying to make it look for files in a
> > db table called FTPTEST. But no matter what I do it returns:
> > Java.io.FileNotFoundException: res\home\kenneth (Access is denied)
> >
> > I created a file from a blob and returned it in getFile(), but how am
> > I supposed to make it LIST from the db? All I need atm is the ftp
> > showing files in a single folder. No dir's needed. Anyone got a good
> > idea how to do this?
> >
> > Kenneth
> >
> > -----Original Message-----
> > From: Niklas Gustavsson [mailto:niklas@protocol7.com]
> > Sent: 19. mars 2010 14:43
> > To: ftpserver-users@mina.apache.org
> > Subject: Re: LIST from database
> >
> > On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com>
> wrote:
> >
> >> You should create your own FileSystemFactory  and set it in the
> >> DefaultFtpServerContext like this:
> >>  context.setFileSystemManager(filesystemFactory);
> >>
> >
> > Or you can set it on the FtpServerFactory. Or, you can configure it as
> > a bean in the Spring config.
> >
> > /niklas
> >
> >
> >
> >
>
>
>

Re: LIST from database

Posted by "Brett M. Bergquist" <br...@thebergquistfamily.com>.
If you find something in the implementation that needs to be changed, 
let me know if you could. 

Thanks.

Kenneth Vanvik Hansen wrote:
> I think i actually found something now. Need to rewrite some stuff to make
> it work with the views again. Thanks for your help anyway :-)
>
> Kenneth
>
> -----Original Message-----
> From: Brett Bergquist [mailto:brett@thebergquistfamily.com] 
> Sent: 3. mai 2010 12:50
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
>
> Actually right now, no.  Maybe throw some debug statements around or profile
> it to see where it is spending the time.  Maybe that will give  clue as to
> where it needs to be optimized.
>
> Brett
>
> On May 3, 2010, at 6:37 AM, Kenneth Vanvik Hansen wrote:
>
>   
>> Hi, i've implemented your new code. I still have some trouble with it 
>> being very slow. Listing 12 directories takes about 100 seconds. This 
>> is from a bit complicated view, which might be some of the reason. 
>> Still shouldn't take that long? Any ideas how to make it even faster?
>>
>> Kenneth
>>
>> -----Original Message-----
>> From: Kenneth Vanvik Hansen [mailto:kvhansen@online.no]
>> Sent: 27. april 2010 23:30
>> To: ftpserver-users@mina.apache.org
>> Subject: Re: LIST from database
>>
>> Niice :-) I'll take a look at it tomorrow. I wrote a db view that 
>> creates a folder structure form existing blobs. And there are several 
>> thousand blobs, which is how i found the list command being slow. Thank
>>     
> you.
>   
>> Kenneth
>>
>> On Apr 27, 2010, at 11:13 PM, Brett M. Bergquist wrote:
>>
>>     
>>> I just did a quick modification of my code to not do a select on each
>>>       
>> file. Basically when the "list" is done, I gather all of the 
>> information and cache it in the DbFile object.  This greatly increased 
>> performance so that at directory with a couple of hundred files takes 
>> less than a second to return a directory listing.
>>     
>>> I have created a Jira issue and attached a Netbeans project which is 
>>> a
>>>       
>> running sample against a Derby database.  This has this changed code in
>>     
> it.
>   
>> So you might want to download the code and make the same changes in 
>> your version.
>>     
>>> This is Jira Issue: FTPSERVER-372 </jira/browse/FTPSERVER-372>
>>>
>>> https://issues.apache.org/jira/browse/FTPSERVER-372
>>>
>>>
>>> Brett M. Bergquist wrote:
>>>       
>>>> Sorry, I just saw this among the hundreds of emails that I get ;)
>>>>
>>>> I don't have a quick answer.  It is doing 1 select to get the list 
>>>> of
>>>>         
>> files and then for each other check on each file (isDirectory, 
>> isReadable,
>> etc.) it is doing another select.  It is a very naive implementation 
>> in that it is caching nothing and always refreshing its knowledge from the
>>     
> database.
>   
>> And your right, with many files in a directory it is slow and resource 
>> intensive.
>>     
>>>> Kenneth Vanvik Hansen wrote:
>>>>         
>>>>> No, i don't have a need to do a select for every file. It just 
>>>>> seems it does a lot of queries when it receives a LIST command. 
>>>>> Only change I have done to the original code is I have changed from 
>>>>> Derby to ODBC. It works great for folders with up to 10 or so files 
>>>>> in it, after that it starts to get really slow.
>>>>>
>>>>> -----Original Message-----
>>>>> From: David Latorre [mailto:dvlato@gmail.com] Sent: 27. april 2010
>>>>> 14:10
>>>>> To: ftpserver-users
>>>>> Subject: Re: LIST from database
>>>>>
>>>>> If I inderstood you correctly, it is your code that is doing a 
>>>>> SELECT for every file, isn't it?
>>>>>
>>>>> Since I haven't seen your code, I cannot give you advice on this, 
>>>>> why do you need to do a select for every file?
>>>>>
>>>>> Maybe Brett's solution can help you... did you get the time to work 
>>>>> on this, Brett?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2010/4/27 Kenneth Vanvik Hansen <kv...@online.no>:
>>>>>
>>>>>           
>>>>>> Hi, I've been working on this a bit now but I'm having some 
>>>>>> trouble when there are many files/folders in a folder. Seems like 
>>>>>> LIST does a select for every file in a folder. Any good ideas on 
>>>>>> how to solve this? In my db(which is a bit slow) it can take 
>>>>>> several minutes to list
>>>>>>
>>>>>>             
>>>>> 40+ files/folders.
>>>>>
>>>>>           
>>>>>> Kenneth
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]
>>>>>> Sent: 23. mars 2010 17:40
>>>>>> To: ftpserver-users@mina.apache.org
>>>>>> Subject: Re: LIST from database
>>>>>>
>>>>>> Okay.  That will work.  Thanks.
>>>>>>
>>>>>> Niklas Gustavsson wrote:
>>>>>>
>>>>>>             
>>>>>>> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist
>>>>>>>               
>> <br...@thebergquistfamily.com> wrote:
>>     
>>>>>>>               
>>>>>>>> I actually have a working Netbeans project that works against a 
>>>>>>>> Derby database.  I am going to do a little more cleanup and see 
>>>>>>>> if I cannot factor out the database specifics like the db user 
>>>>>>>> manager does and then I would like to provide the whole thing, 
>>>>>>>> probably to go into the examples.  So should I send this to you 
>>>>>>>> Niklas when I am
>>>>>>>>
>>>>>>>>                 
>>>>> ready?
>>>>>
>>>>>           
>>>>>>> If you would like to contribute the code to the project, the best 
>>>>>>> way
>>>>>>>               
>> is to create a JIRA issue and attach the code there (making sure you 
>> check the donate to ASF checkbox).
>>     
>>>>>>> /niklas
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>             
>>>>>
>>>>>
>>>>>           
>>>       
>> Kenneth Vanvik Hansen
>> kvhansen@online.no
>>
>>
>>
>>
>>     
>
>
>
>   

RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
I think i actually found something now. Need to rewrite some stuff to make
it work with the views again. Thanks for your help anyway :-)

Kenneth

-----Original Message-----
From: Brett Bergquist [mailto:brett@thebergquistfamily.com] 
Sent: 3. mai 2010 12:50
To: ftpserver-users@mina.apache.org
Subject: Re: LIST from database

Actually right now, no.  Maybe throw some debug statements around or profile
it to see where it is spending the time.  Maybe that will give  clue as to
where it needs to be optimized.

Brett

On May 3, 2010, at 6:37 AM, Kenneth Vanvik Hansen wrote:

> Hi, i've implemented your new code. I still have some trouble with it 
> being very slow. Listing 12 directories takes about 100 seconds. This 
> is from a bit complicated view, which might be some of the reason. 
> Still shouldn't take that long? Any ideas how to make it even faster?
> 
> Kenneth
> 
> -----Original Message-----
> From: Kenneth Vanvik Hansen [mailto:kvhansen@online.no]
> Sent: 27. april 2010 23:30
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
> 
> Niice :-) I'll take a look at it tomorrow. I wrote a db view that 
> creates a folder structure form existing blobs. And there are several 
> thousand blobs, which is how i found the list command being slow. Thank
you.
> 
> Kenneth
> 
> On Apr 27, 2010, at 11:13 PM, Brett M. Bergquist wrote:
> 
>> I just did a quick modification of my code to not do a select on each
> file. Basically when the "list" is done, I gather all of the 
> information and cache it in the DbFile object.  This greatly increased 
> performance so that at directory with a couple of hundred files takes 
> less than a second to return a directory listing.
>> 
>> I have created a Jira issue and attached a Netbeans project which is 
>> a
> running sample against a Derby database.  This has this changed code in
it.
> So you might want to download the code and make the same changes in 
> your version.
>> 
>> This is Jira Issue: FTPSERVER-372 </jira/browse/FTPSERVER-372>
>> 
>> https://issues.apache.org/jira/browse/FTPSERVER-372
>> 
>> 
>> Brett M. Bergquist wrote:
>>> Sorry, I just saw this among the hundreds of emails that I get ;)
>>> 
>>> I don't have a quick answer.  It is doing 1 select to get the list 
>>> of
> files and then for each other check on each file (isDirectory, 
> isReadable,
> etc.) it is doing another select.  It is a very naive implementation 
> in that it is caching nothing and always refreshing its knowledge from the
database.
> And your right, with many files in a directory it is slow and resource 
> intensive.
>>> 
>>> Kenneth Vanvik Hansen wrote:
>>>> No, i don't have a need to do a select for every file. It just 
>>>> seems it does a lot of queries when it receives a LIST command. 
>>>> Only change I have done to the original code is I have changed from 
>>>> Derby to ODBC. It works great for folders with up to 10 or so files 
>>>> in it, after that it starts to get really slow.
>>>> 
>>>> -----Original Message-----
>>>> From: David Latorre [mailto:dvlato@gmail.com] Sent: 27. april 2010
>>>> 14:10
>>>> To: ftpserver-users
>>>> Subject: Re: LIST from database
>>>> 
>>>> If I inderstood you correctly, it is your code that is doing a 
>>>> SELECT for every file, isn't it?
>>>> 
>>>> Since I haven't seen your code, I cannot give you advice on this, 
>>>> why do you need to do a select for every file?
>>>> 
>>>> Maybe Brett's solution can help you... did you get the time to work 
>>>> on this, Brett?
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 2010/4/27 Kenneth Vanvik Hansen <kv...@online.no>:
>>>> 
>>>>> Hi, I've been working on this a bit now but I'm having some 
>>>>> trouble when there are many files/folders in a folder. Seems like 
>>>>> LIST does a select for every file in a folder. Any good ideas on 
>>>>> how to solve this? In my db(which is a bit slow) it can take 
>>>>> several minutes to list
>>>>> 
>>>> 40+ files/folders.
>>>> 
>>>>> Kenneth
>>>>> 
>>>>> -----Original Message-----
>>>>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]
>>>>> Sent: 23. mars 2010 17:40
>>>>> To: ftpserver-users@mina.apache.org
>>>>> Subject: Re: LIST from database
>>>>> 
>>>>> Okay.  That will work.  Thanks.
>>>>> 
>>>>> Niklas Gustavsson wrote:
>>>>> 
>>>>>> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist
> <br...@thebergquistfamily.com> wrote:
>>>>>> 
>>>>>> 
>>>>>>> I actually have a working Netbeans project that works against a 
>>>>>>> Derby database.  I am going to do a little more cleanup and see 
>>>>>>> if I cannot factor out the database specifics like the db user 
>>>>>>> manager does and then I would like to provide the whole thing, 
>>>>>>> probably to go into the examples.  So should I send this to you 
>>>>>>> Niklas when I am
>>>>>>> 
>>>> ready?
>>>> 
>>>>>> If you would like to contribute the code to the project, the best 
>>>>>> way
> is to create a JIRA issue and attach the code there (making sure you 
> check the donate to ASF checkbox).
>>>>>> 
>>>>>> /niklas
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
> 
> Kenneth Vanvik Hansen
> kvhansen@online.no
> 
> 
> 
> 



Re: LIST from database

Posted by Brett Bergquist <br...@thebergquistfamily.com>.
Actually right now, no.  Maybe throw some debug statements around or profile it to see where it is spending the time.  Maybe that will give  clue as to where it needs to be optimized.

Brett

On May 3, 2010, at 6:37 AM, Kenneth Vanvik Hansen wrote:

> Hi, i've implemented your new code. I still have some trouble with it being
> very slow. Listing 12 directories takes about 100 seconds. This is from a
> bit complicated view, which might be some of the reason. Still shouldn't
> take that long? Any ideas how to make it even faster?
> 
> Kenneth
> 
> -----Original Message-----
> From: Kenneth Vanvik Hansen [mailto:kvhansen@online.no] 
> Sent: 27. april 2010 23:30
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
> 
> Niice :-) I'll take a look at it tomorrow. I wrote a db view that creates a
> folder structure form existing blobs. And there are several thousand blobs,
> which is how i found the list command being slow. Thank you.
> 
> Kenneth
> 
> On Apr 27, 2010, at 11:13 PM, Brett M. Bergquist wrote:
> 
>> I just did a quick modification of my code to not do a select on each
> file. Basically when the "list" is done, I gather all of the information and
> cache it in the DbFile object.  This greatly increased performance so that
> at directory with a couple of hundred files takes less than a second to
> return a directory listing.
>> 
>> I have created a Jira issue and attached a Netbeans project which is a
> running sample against a Derby database.  This has this changed code in it.
> So you might want to download the code and make the same changes in your
> version.
>> 
>> This is Jira Issue: FTPSERVER-372 </jira/browse/FTPSERVER-372>
>> 
>> https://issues.apache.org/jira/browse/FTPSERVER-372
>> 
>> 
>> Brett M. Bergquist wrote:
>>> Sorry, I just saw this among the hundreds of emails that I get ;)
>>> 
>>> I don't have a quick answer.  It is doing 1 select to get the list of
> files and then for each other check on each file (isDirectory, isReadable,
> etc.) it is doing another select.  It is a very naive implementation in that
> it is caching nothing and always refreshing its knowledge from the database.
> And your right, with many files in a directory it is slow and resource
> intensive.
>>> 
>>> Kenneth Vanvik Hansen wrote:
>>>> No, i don't have a need to do a select for every file. It just seems 
>>>> it does a lot of queries when it receives a LIST command. Only 
>>>> change I have done to the original code is I have changed from Derby 
>>>> to ODBC. It works great for folders with up to 10 or so files in it, 
>>>> after that it starts to get really slow.
>>>> 
>>>> -----Original Message-----
>>>> From: David Latorre [mailto:dvlato@gmail.com] Sent: 27. april 2010 
>>>> 14:10
>>>> To: ftpserver-users
>>>> Subject: Re: LIST from database
>>>> 
>>>> If I inderstood you correctly, it is your code that is doing a 
>>>> SELECT for every file, isn't it?
>>>> 
>>>> Since I haven't seen your code, I cannot give you advice on this, 
>>>> why do you need to do a select for every file?
>>>> 
>>>> Maybe Brett's solution can help you... did you get the time to work 
>>>> on this, Brett?
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 2010/4/27 Kenneth Vanvik Hansen <kv...@online.no>:
>>>> 
>>>>> Hi, I've been working on this a bit now but I'm having some trouble 
>>>>> when there are many files/folders in a folder. Seems like LIST does 
>>>>> a select for every file in a folder. Any good ideas on how to solve 
>>>>> this? In my db(which is a bit slow) it can take several minutes to 
>>>>> list
>>>>> 
>>>> 40+ files/folders.
>>>> 
>>>>> Kenneth
>>>>> 
>>>>> -----Original Message-----
>>>>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]
>>>>> Sent: 23. mars 2010 17:40
>>>>> To: ftpserver-users@mina.apache.org
>>>>> Subject: Re: LIST from database
>>>>> 
>>>>> Okay.  That will work.  Thanks.
>>>>> 
>>>>> Niklas Gustavsson wrote:
>>>>> 
>>>>>> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist
> <br...@thebergquistfamily.com> wrote:
>>>>>> 
>>>>>> 
>>>>>>> I actually have a working Netbeans project that works against a 
>>>>>>> Derby database.  I am going to do a little more cleanup and see 
>>>>>>> if I cannot factor out the database specifics like the db user 
>>>>>>> manager does and then I would like to provide the whole thing, 
>>>>>>> probably to go into the examples.  So should I send this to you 
>>>>>>> Niklas when I am
>>>>>>> 
>>>> ready?
>>>> 
>>>>>> If you would like to contribute the code to the project, the best way
> is to create a JIRA issue and attach the code there (making sure you check
> the donate to ASF checkbox).
>>>>>> 
>>>>>> /niklas
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
> 
> Kenneth Vanvik Hansen
> kvhansen@online.no
> 
> 
> 
> 


RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
Hi, i've implemented your new code. I still have some trouble with it being
very slow. Listing 12 directories takes about 100 seconds. This is from a
bit complicated view, which might be some of the reason. Still shouldn't
take that long? Any ideas how to make it even faster?

Kenneth

-----Original Message-----
From: Kenneth Vanvik Hansen [mailto:kvhansen@online.no] 
Sent: 27. april 2010 23:30
To: ftpserver-users@mina.apache.org
Subject: Re: LIST from database

Niice :-) I'll take a look at it tomorrow. I wrote a db view that creates a
folder structure form existing blobs. And there are several thousand blobs,
which is how i found the list command being slow. Thank you.

Kenneth

On Apr 27, 2010, at 11:13 PM, Brett M. Bergquist wrote:

> I just did a quick modification of my code to not do a select on each
file. Basically when the "list" is done, I gather all of the information and
cache it in the DbFile object.  This greatly increased performance so that
at directory with a couple of hundred files takes less than a second to
return a directory listing.
> 
> I have created a Jira issue and attached a Netbeans project which is a
running sample against a Derby database.  This has this changed code in it.
So you might want to download the code and make the same changes in your
version.
> 
> This is Jira Issue: FTPSERVER-372 </jira/browse/FTPSERVER-372>
> 
> https://issues.apache.org/jira/browse/FTPSERVER-372
> 
> 
> Brett M. Bergquist wrote:
>> Sorry, I just saw this among the hundreds of emails that I get ;)
>> 
>> I don't have a quick answer.  It is doing 1 select to get the list of
files and then for each other check on each file (isDirectory, isReadable,
etc.) it is doing another select.  It is a very naive implementation in that
it is caching nothing and always refreshing its knowledge from the database.
And your right, with many files in a directory it is slow and resource
intensive.
>> 
>> Kenneth Vanvik Hansen wrote:
>>> No, i don't have a need to do a select for every file. It just seems 
>>> it does a lot of queries when it receives a LIST command. Only 
>>> change I have done to the original code is I have changed from Derby 
>>> to ODBC. It works great for folders with up to 10 or so files in it, 
>>> after that it starts to get really slow.
>>> 
>>> -----Original Message-----
>>> From: David Latorre [mailto:dvlato@gmail.com] Sent: 27. april 2010 
>>> 14:10
>>> To: ftpserver-users
>>> Subject: Re: LIST from database
>>> 
>>> If I inderstood you correctly, it is your code that is doing a 
>>> SELECT for every file, isn't it?
>>> 
>>> Since I haven't seen your code, I cannot give you advice on this, 
>>> why do you need to do a select for every file?
>>> 
>>> Maybe Brett's solution can help you... did you get the time to work 
>>> on this, Brett?
>>> 
>>> 
>>> 
>>> 
>>> 2010/4/27 Kenneth Vanvik Hansen <kv...@online.no>:
>>> 
>>>> Hi, I've been working on this a bit now but I'm having some trouble 
>>>> when there are many files/folders in a folder. Seems like LIST does 
>>>> a select for every file in a folder. Any good ideas on how to solve 
>>>> this? In my db(which is a bit slow) it can take several minutes to 
>>>> list
>>>>    
>>> 40+ files/folders.
>>> 
>>>> Kenneth
>>>> 
>>>> -----Original Message-----
>>>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]
>>>> Sent: 23. mars 2010 17:40
>>>> To: ftpserver-users@mina.apache.org
>>>> Subject: Re: LIST from database
>>>> 
>>>> Okay.  That will work.  Thanks.
>>>> 
>>>> Niklas Gustavsson wrote:
>>>>   
>>>>> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist
<br...@thebergquistfamily.com> wrote:
>>>>> 
>>>>>     
>>>>>> I actually have a working Netbeans project that works against a 
>>>>>> Derby database.  I am going to do a little more cleanup and see 
>>>>>> if I cannot factor out the database specifics like the db user 
>>>>>> manager does and then I would like to provide the whole thing, 
>>>>>> probably to go into the examples.  So should I send this to you 
>>>>>> Niklas when I am
>>>>>>        
>>> ready?
>>> 
>>>>> If you would like to contribute the code to the project, the best way
is to create a JIRA issue and attach the code there (making sure you check
the donate to ASF checkbox).
>>>>> 
>>>>> /niklas
>>>>> 
>>>>> 
>>>>>      
>>>> 
>>>>    
>>> 
>>> 
>>> 
>>>  
>> 
> 
> 

Kenneth Vanvik Hansen
kvhansen@online.no





Re: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
Niice :-) I'll take a look at it tomorrow. I wrote a db view that creates a folder structure form existing blobs. And there are several thousand blobs, which is how i found the list command being slow. Thank you.

Kenneth

On Apr 27, 2010, at 11:13 PM, Brett M. Bergquist wrote:

> I just did a quick modification of my code to not do a select on each file. Basically when the "list" is done, I gather all of the information and cache it in the DbFile object.  This greatly increased performance so that at directory with a couple of hundred files takes less than a second to return a directory listing.
> 
> I have created a Jira issue and attached a Netbeans project which is a running sample against a Derby database.  This has this changed code in it.  So you might want to download the code and make the same changes in your version.
> 
> This is Jira Issue: FTPSERVER-372 </jira/browse/FTPSERVER-372>
> 
> https://issues.apache.org/jira/browse/FTPSERVER-372
> 
> 
> Brett M. Bergquist wrote:
>> Sorry, I just saw this among the hundreds of emails that I get ;)
>> 
>> I don't have a quick answer.  It is doing 1 select to get the list of files and then for each other check on each file (isDirectory, isReadable, etc.) it is doing another select.  It is a very naive implementation in that it is caching nothing and always refreshing its knowledge from the database.   And your right, with many files in a directory it is slow and resource intensive.
>> 
>> Kenneth Vanvik Hansen wrote:
>>> No, i don't have a need to do a select for every file. It just seems it does
>>> a lot of queries when it receives a LIST command. Only change I have done to
>>> the original code is I have changed from Derby to ODBC. It works great for
>>> folders with up to 10 or so files in it, after that it starts to get really
>>> slow.
>>> 
>>> -----Original Message-----
>>> From: David Latorre [mailto:dvlato@gmail.com] Sent: 27. april 2010 14:10
>>> To: ftpserver-users
>>> Subject: Re: LIST from database
>>> 
>>> If I inderstood you correctly, it is your code that is doing a SELECT for
>>> every file, isn't it?
>>> 
>>> Since I haven't seen your code, I cannot give you advice on this, why do you
>>> need to do a select for every file?
>>> 
>>> Maybe Brett's solution can help you... did you get the time to work on this,
>>> Brett?
>>> 
>>> 
>>> 
>>> 
>>> 2010/4/27 Kenneth Vanvik Hansen <kv...@online.no>:
>>> 
>>>> Hi, I've been working on this a bit now but I'm having some trouble when there are many files/folders in a folder. Seems like LIST does a select for every file in a folder. Any good ideas on how to solve this? In my db(which is a bit slow) it can take several minutes to list
>>>>    
>>> 40+ files/folders.
>>> 
>>>> Kenneth
>>>> 
>>>> -----Original Message-----
>>>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]
>>>> Sent: 23. mars 2010 17:40
>>>> To: ftpserver-users@mina.apache.org
>>>> Subject: Re: LIST from database
>>>> 
>>>> Okay.  That will work.  Thanks.
>>>> 
>>>> Niklas Gustavsson wrote:
>>>>   
>>>>> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist <br...@thebergquistfamily.com> wrote:
>>>>> 
>>>>>     
>>>>>> I actually have a working Netbeans project that works against a Derby database.  I am going to do a little more cleanup and see if I cannot factor out the database specifics like the db user manager does and then I would like to provide the whole thing, probably to go into the examples.  So should I send this to you Niklas when I am
>>>>>>        
>>> ready?
>>> 
>>>>> If you would like to contribute the code to the project, the best way is to create a JIRA issue and attach the code there (making sure you check the donate to ASF checkbox).
>>>>> 
>>>>> /niklas
>>>>> 
>>>>> 
>>>>>      
>>>> 
>>>>    
>>> 
>>> 
>>> 
>>>  
>> 
> 
> 

Kenneth Vanvik Hansen
kvhansen@online.no




Re: LIST from database

Posted by "Brett M. Bergquist" <br...@thebergquistfamily.com>.
I just did a quick modification of my code to not do a select on each 
file. Basically when the "list" is done, I gather all of the information 
and cache it in the DbFile object.  This greatly increased performance 
so that at directory with a couple of hundred files takes less than a 
second to return a directory listing.

I have created a Jira issue and attached a Netbeans project which is a 
running sample against a Derby database.  This has this changed code in 
it.  So you might want to download the code and make the same changes in 
your version.

This is Jira Issue: FTPSERVER-372 </jira/browse/FTPSERVER-372>

https://issues.apache.org/jira/browse/FTPSERVER-372


Brett M. Bergquist wrote:
> Sorry, I just saw this among the hundreds of emails that I get ;)
>
> I don't have a quick answer.  It is doing 1 select to get the list of 
> files and then for each other check on each file (isDirectory, 
> isReadable, etc.) it is doing another select.  It is a very naive 
> implementation in that it is caching nothing and always refreshing its 
> knowledge from the database.   And your right, with many files in a 
> directory it is slow and resource intensive.
>
> Kenneth Vanvik Hansen wrote:
>> No, i don't have a need to do a select for every file. It just seems 
>> it does
>> a lot of queries when it receives a LIST command. Only change I have 
>> done to
>> the original code is I have changed from Derby to ODBC. It works 
>> great for
>> folders with up to 10 or so files in it, after that it starts to get 
>> really
>> slow.
>>
>> -----Original Message-----
>> From: David Latorre [mailto:dvlato@gmail.com] Sent: 27. april 2010 14:10
>> To: ftpserver-users
>> Subject: Re: LIST from database
>>
>> If I inderstood you correctly, it is your code that is doing a SELECT 
>> for
>> every file, isn't it?
>>
>> Since I haven't seen your code, I cannot give you advice on this, why 
>> do you
>> need to do a select for every file?
>>
>> Maybe Brett's solution can help you... did you get the time to work 
>> on this,
>> Brett?
>>
>>
>>
>>
>> 2010/4/27 Kenneth Vanvik Hansen <kv...@online.no>:
>>  
>>> Hi, I've been working on this a bit now but I'm having some trouble 
>>> when there are many files/folders in a folder. Seems like LIST does 
>>> a select for every file in a folder. Any good ideas on how to solve 
>>> this? In my db(which is a bit slow) it can take several minutes to list
>>>     
>> 40+ files/folders.
>>  
>>> Kenneth
>>>
>>> -----Original Message-----
>>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]
>>> Sent: 23. mars 2010 17:40
>>> To: ftpserver-users@mina.apache.org
>>> Subject: Re: LIST from database
>>>
>>> Okay.  That will work.  Thanks.
>>>
>>> Niklas Gustavsson wrote:
>>>    
>>>> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist 
>>>> <br...@thebergquistfamily.com> wrote:
>>>>
>>>>      
>>>>> I actually have a working Netbeans project that works against a 
>>>>> Derby database.  I am going to do a little more cleanup and see if 
>>>>> I cannot factor out the database specifics like the db user 
>>>>> manager does and then I would like to provide the whole thing, 
>>>>> probably to go into the examples.  So should I send this to you 
>>>>> Niklas when I am
>>>>>         
>> ready?
>>  
>>>> If you would like to contribute the code to the project, the best 
>>>> way is to create a JIRA issue and attach the code there (making 
>>>> sure you check the donate to ASF checkbox).
>>>>
>>>> /niklas
>>>>
>>>>
>>>>       
>>>
>>>     
>>
>>
>>
>>   
>

Re: LIST from database

Posted by "Brett M. Bergquist" <br...@thebergquistfamily.com>.
Sorry, I just saw this among the hundreds of emails that I get ;)

I don't have a quick answer.  It is doing 1 select to get the list of 
files and then for each other check on each file (isDirectory, 
isReadable, etc.) it is doing another select.  It is a very naive 
implementation in that it is caching nothing and always refreshing its 
knowledge from the database.   And your right, with many files in a 
directory it is slow and resource intensive.

Kenneth Vanvik Hansen wrote:
> No, i don't have a need to do a select for every file. It just seems it does
> a lot of queries when it receives a LIST command. Only change I have done to
> the original code is I have changed from Derby to ODBC. It works great for
> folders with up to 10 or so files in it, after that it starts to get really
> slow.
>
> -----Original Message-----
> From: David Latorre [mailto:dvlato@gmail.com] 
> Sent: 27. april 2010 14:10
> To: ftpserver-users
> Subject: Re: LIST from database
>
> If I inderstood you correctly, it is your code that is doing a SELECT for
> every file, isn't it?
>
> Since I haven't seen your code, I cannot give you advice on this, why do you
> need to do a select for every file?
>
> Maybe Brett's solution can help you... did you get the time to work on this,
> Brett?
>
>
>
>
> 2010/4/27 Kenneth Vanvik Hansen <kv...@online.no>:
>   
>> Hi, I've been working on this a bit now but I'm having some trouble 
>> when there are many files/folders in a folder. Seems like LIST does a 
>> select for every file in a folder. Any good ideas on how to solve 
>> this? In my db(which is a bit slow) it can take several minutes to list
>>     
> 40+ files/folders.
>   
>> Kenneth
>>
>> -----Original Message-----
>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]
>> Sent: 23. mars 2010 17:40
>> To: ftpserver-users@mina.apache.org
>> Subject: Re: LIST from database
>>
>> Okay.  That will work.  Thanks.
>>
>> Niklas Gustavsson wrote:
>>     
>>> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist 
>>> <br...@thebergquistfamily.com> wrote:
>>>
>>>       
>>>> I actually have a working Netbeans project that works against a 
>>>> Derby database.  I am going to do a little more cleanup and see if I 
>>>> cannot factor out the database specifics like the db user manager 
>>>> does and then I would like to provide the whole thing, probably to 
>>>> go into the examples.  So should I send this to you Niklas when I am
>>>>         
> ready?
>   
>>> If you would like to contribute the code to the project, the best way 
>>> is to create a JIRA issue and attach the code there (making sure you 
>>> check the donate to ASF checkbox).
>>>
>>> /niklas
>>>
>>>
>>>       
>>
>>     
>
>
>
>   

RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
No, i don't have a need to do a select for every file. It just seems it does
a lot of queries when it receives a LIST command. Only change I have done to
the original code is I have changed from Derby to ODBC. It works great for
folders with up to 10 or so files in it, after that it starts to get really
slow.

-----Original Message-----
From: David Latorre [mailto:dvlato@gmail.com] 
Sent: 27. april 2010 14:10
To: ftpserver-users
Subject: Re: LIST from database

If I inderstood you correctly, it is your code that is doing a SELECT for
every file, isn't it?

Since I haven't seen your code, I cannot give you advice on this, why do you
need to do a select for every file?

Maybe Brett's solution can help you... did you get the time to work on this,
Brett?




2010/4/27 Kenneth Vanvik Hansen <kv...@online.no>:
> Hi, I've been working on this a bit now but I'm having some trouble 
> when there are many files/folders in a folder. Seems like LIST does a 
> select for every file in a folder. Any good ideas on how to solve 
> this? In my db(which is a bit slow) it can take several minutes to list
40+ files/folders.
>
> Kenneth
>
> -----Original Message-----
> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]
> Sent: 23. mars 2010 17:40
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
>
> Okay.  That will work.  Thanks.
>
> Niklas Gustavsson wrote:
>> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist 
>> <br...@thebergquistfamily.com> wrote:
>>
>>> I actually have a working Netbeans project that works against a 
>>> Derby database.  I am going to do a little more cleanup and see if I 
>>> cannot factor out the database specifics like the db user manager 
>>> does and then I would like to provide the whole thing, probably to 
>>> go into the examples.  So should I send this to you Niklas when I am
ready?
>>>
>>
>> If you would like to contribute the code to the project, the best way 
>> is to create a JIRA issue and attach the code there (making sure you 
>> check the donate to ASF checkbox).
>>
>> /niklas
>>
>>
>
>
>



Re: LIST from database

Posted by David Latorre <dv...@gmail.com>.
If I inderstood you correctly, it is your code that is doing a SELECT
for every file, isn't it?

Since I haven't seen your code, I cannot give you advice on this, why
do you need to do a select for every file?

Maybe Brett's solution can help you... did you get the time to work on
this, Brett?




2010/4/27 Kenneth Vanvik Hansen <kv...@online.no>:
> Hi, I've been working on this a bit now but I'm having some trouble when
> there are many files/folders in a folder. Seems like LIST does a select for
> every file in a folder. Any good ideas on how to solve this? In my db(which
> is a bit slow) it can take several minutes to list 40+ files/folders.
>
> Kenneth
>
> -----Original Message-----
> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]
> Sent: 23. mars 2010 17:40
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
>
> Okay.  That will work.  Thanks.
>
> Niklas Gustavsson wrote:
>> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist
>> <br...@thebergquistfamily.com> wrote:
>>
>>> I actually have a working Netbeans project that works against a Derby
>>> database.  I am going to do a little more cleanup and see if I cannot
>>> factor out the database specifics like the db user manager does and
>>> then I would like to provide the whole thing, probably to go into the
>>> examples.  So should I send this to you Niklas when I am ready?
>>>
>>
>> If you would like to contribute the code to the project, the best way
>> is to create a JIRA issue and attach the code there (making sure you
>> check the donate to ASF checkbox).
>>
>> /niklas
>>
>>
>
>
>

RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
Hi, I've been working on this a bit now but I'm having some trouble when
there are many files/folders in a folder. Seems like LIST does a select for
every file in a folder. Any good ideas on how to solve this? In my db(which
is a bit slow) it can take several minutes to list 40+ files/folders.

Kenneth

-----Original Message-----
From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com] 
Sent: 23. mars 2010 17:40
To: ftpserver-users@mina.apache.org
Subject: Re: LIST from database

Okay.  That will work.  Thanks.

Niklas Gustavsson wrote:
> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist 
> <br...@thebergquistfamily.com> wrote:
>   
>> I actually have a working Netbeans project that works against a Derby 
>> database.  I am going to do a little more cleanup and see if I cannot 
>> factor out the database specifics like the db user manager does and 
>> then I would like to provide the whole thing, probably to go into the 
>> examples.  So should I send this to you Niklas when I am ready?
>>     
>
> If you would like to contribute the code to the project, the best way 
> is to create a JIRA issue and attach the code there (making sure you 
> check the donate to ASF checkbox).
>
> /niklas
>
>   



Re: LIST from database

Posted by "Brett M. Bergquist" <br...@thebergquistfamily.com>.
Okay.  That will work.  Thanks.

Niklas Gustavsson wrote:
> On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist
> <br...@thebergquistfamily.com> wrote:
>   
>> I actually have a working Netbeans project that works against a Derby
>> database.  I am going to do a little more cleanup and see if I cannot factor
>> out the database specifics like the db user manager does and then I would
>> like to provide the whole thing, probably to go into the examples.  So
>> should I send this to you Niklas when I am ready?
>>     
>
> If you would like to contribute the code to the project, the best way
> is to create a JIRA issue and attach the code there (making sure you
> check the donate to ASF checkbox).
>
> /niklas
>
>   

Re: LIST from database

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Tue, Mar 23, 2010 at 4:08 PM, Brett M. Bergquist
<br...@thebergquistfamily.com> wrote:
> I actually have a working Netbeans project that works against a Derby
> database.  I am going to do a little more cleanup and see if I cannot factor
> out the database specifics like the db user manager does and then I would
> like to provide the whole thing, probably to go into the examples.  So
> should I send this to you Niklas when I am ready?

If you would like to contribute the code to the project, the best way
is to create a JIRA issue and attach the code there (making sure you
check the donate to ASF checkbox).

/niklas

Re: LIST from database

Posted by "Brett M. Bergquist" <br...@thebergquistfamily.com>.
I actually have a working Netbeans project that works against a Derby 
database.  I am going to do a little more cleanup and see if I cannot 
factor out the database specifics like the db user manager does and then 
I would like to provide the whole thing, probably to go into the 
examples.  So should I send this to you Niklas when I am ready?

Niklas Gustavsson wrote:
> On Tue, Mar 23, 2010 at 3:17 PM, Brett M. Bergquist
> <br...@thebergquistfamily.com> wrote:
>   
>> Oops, I sent the file to the wrong address.  In any case, what is the best
>> mechanism that I can use to supply a working example of supporting a file
>> system using a database to the project?
>>     
>
> What you just did is a good start :-)
>
> /niklas
>
>   

Re: LIST from database

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Tue, Mar 23, 2010 at 3:17 PM, Brett M. Bergquist
<br...@thebergquistfamily.com> wrote:
> Oops, I sent the file to the wrong address.  In any case, what is the best
> mechanism that I can use to supply a working example of supporting a file
> system using a database to the project?

What you just did is a good start :-)

/niklas

Re: LIST from database

Posted by "Brett M. Bergquist" <br...@thebergquistfamily.com>.
Oops, I sent the file to the wrong address.  In any case, what is the 
best mechanism that I can use to supply a working example of supporting 
a file system using a database to the project?

Brett M. Bergquist wrote:
> Here is the new DbFile.java that does not require a separate View.
>
>
> Kenneth Vanvik Hansen wrote:
>> Sounds good, I'll probably have them by tonight then :-) Thank you.
>>
>> Kenneth
>>
>> -----Original Message-----
>> From: Brett Bergquist [mailto:brett@thebergquistfamily.com] Sent: 21. 
>> mars 2010 23:11
>> To: ftpserver-users@mina.apache.org
>> Subject: Re: LIST from database
>>
>> I should have them sometime Monday.  They are at work and I am at 
>> home :)  I
>> ended up working all Saturday but not on this :(  I extracted the 
>> files out
>> to extract on their own and I just want to run a few tests and then I 
>> will
>> have them to post.
>>
>> Brett
>>
>> On Mar 21, 2010, at 5:00 PM, Kenneth Vanvik Hansen wrote:
>>
>>  
>>> How are you doing with those files?
>>>
>>> Kenneth
>>>
>>> On 19. mars 2010, at 18.55, "Brett M. Bergquist"
>>>     
>> <br...@thebergquistfamily.com> wrote:
>>  
>>>> Give me a few hours and I will get the files together and provide 
>>>> them.
>>>> It turns out, I was not using JPA in the FTP side of things but put 
>>>> a JPA
>>>>       
>> interface on top of the database side to allow my web application to 
>> provide
>> an easy interface to list what was in the storage, delete files, etc. 
>> from a
>> Web page.  So the code is straight JDBC access that right now is 
>> targeted to
>> a Derby database, but nothing really special used from that.
>>  
>>>> Kenneth Vanvik Hansen wrote:
>>>>      
>>>>> Not using JPA at the moment, but i probably could if i wanted to. 
>>>>> If you could send me the files it might save me a lot of work. 
>>>>> Using an Oracle database, but I could probably make the required 
>>>>> changes myself.
>>>>>         
>> Thanks.
>>  
>>>>> Kenneth
>>>>>
>>>>> kvhansen@online.no
>>>>>
>>>>> -----Original Message-----
>>>>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com] 
>>>>> Sent: 19. mars 2010 16:42
>>>>> To: ftpserver-users@mina.apache.org
>>>>> Subject: Re: LIST from database
>>>>>
>>>>> Kenneth are you using JPA or can use JPA?  I have this implemented 
>>>>> in JPA and I could send you the files but they are not clean in 
>>>>> that they reference tables in my database, etc.  From the files, 
>>>>> you could extract what you need, however.  Or probably by Monday, 
>>>>> I could have this cleaned up enough to submit back.
>>>>>
>>>>> Files are stored in the DB as blobs and I have 
>>>>> directory/subdirectory, list, put, get, and delete all working using
>>>>>         
>> Derby as my target database.
>>  
>>>>> Kenneth Vanvik Hansen wrote:
>>>>>
>>>>>        
>>>>>> Thanks, got it running. Now i'm trying to make it look for files 
>>>>>> in a
>>>>>>           
>> db table called FTPTEST. But no matter what I do it returns:
>>  
>>>>>> Java.io.FileNotFoundException: res\home\kenneth (Access is denied)
>>>>>>
>>>>>> I created a file from a blob and returned it in getFile(), but 
>>>>>> how am I
>>>>>>           
>> supposed to make it LIST from the db? All I need atm is the ftp showing
>> files in a single folder. No dir's needed. Anyone got a good idea how 
>> to do
>> this?
>>  
>>>>>> Kenneth
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Niklas Gustavsson [mailto:niklas@protocol7.com]
>>>>>> Sent: 19. mars 2010 14:43
>>>>>> To: ftpserver-users@mina.apache.org
>>>>>> Subject: Re: LIST from database
>>>>>>
>>>>>> On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com>
>>>>>>           
>> wrote:
>>  
>>>>>>> You should create your own FileSystemFactory  and set it in the
>>>>>>>             
>> DefaultFtpServerContext like this:
>>  
>>>>>>> context.setFileSystemManager(filesystemFactory);
>>>>>>>
>>>>>>>             
>>>>>> Or you can set it on the FtpServerFactory. Or, you can configure 
>>>>>> it as
>>>>>>           
>> a bean in the Spring config.
>>  
>>>>>> /niklas
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>           
>>>>>
>>>>>
>>>>>         
>>
>>
>>
>>   

Re: LIST from database

Posted by "Brett M. Bergquist" <br...@thebergquistfamily.com>.
Here is the new DbFile.java that does not require a separate View.


Kenneth Vanvik Hansen wrote:
> Sounds good, I'll probably have them by tonight then :-) Thank you.
>
> Kenneth
>
> -----Original Message-----
> From: Brett Bergquist [mailto:brett@thebergquistfamily.com] 
> Sent: 21. mars 2010 23:11
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
>
> I should have them sometime Monday.  They are at work and I am at home :)  I
> ended up working all Saturday but not on this :(  I extracted the files out
> to extract on their own and I just want to run a few tests and then I will
> have them to post.
>
> Brett
>
> On Mar 21, 2010, at 5:00 PM, Kenneth Vanvik Hansen wrote:
>
>   
>> How are you doing with those files?
>>
>> Kenneth
>>
>> On 19. mars 2010, at 18.55, "Brett M. Bergquist"
>>     
> <br...@thebergquistfamily.com> wrote:
>   
>>> Give me a few hours and I will get the files together and provide them.
>>> It turns out, I was not using JPA in the FTP side of things but put a JPA
>>>       
> interface on top of the database side to allow my web application to provide
> an easy interface to list what was in the storage, delete files, etc. from a
> Web page.  So the code is straight JDBC access that right now is targeted to
> a Derby database, but nothing really special used from that.
>   
>>> Kenneth Vanvik Hansen wrote:
>>>       
>>>> Not using JPA at the moment, but i probably could if i wanted to. If 
>>>> you could send me the files it might save me a lot of work. Using an 
>>>> Oracle database, but I could probably make the required changes myself.
>>>>         
> Thanks.
>   
>>>> Kenneth
>>>>
>>>> kvhansen@online.no
>>>>
>>>> -----Original Message-----
>>>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com] Sent: 
>>>> 19. mars 2010 16:42
>>>> To: ftpserver-users@mina.apache.org
>>>> Subject: Re: LIST from database
>>>>
>>>> Kenneth are you using JPA or can use JPA?  I have this implemented 
>>>> in JPA and I could send you the files but they are not clean in that 
>>>> they reference tables in my database, etc.  From the files, you 
>>>> could extract what you need, however.  Or probably by Monday, I 
>>>> could have this cleaned up enough to submit back.
>>>>
>>>> Files are stored in the DB as blobs and I have 
>>>> directory/subdirectory, list, put, get, and delete all working using
>>>>         
> Derby as my target database.
>   
>>>> Kenneth Vanvik Hansen wrote:
>>>>
>>>>         
>>>>> Thanks, got it running. Now i'm trying to make it look for files in a
>>>>>           
> db table called FTPTEST. But no matter what I do it returns:
>   
>>>>> Java.io.FileNotFoundException: res\home\kenneth (Access is denied)
>>>>>
>>>>> I created a file from a blob and returned it in getFile(), but how am I
>>>>>           
> supposed to make it LIST from the db? All I need atm is the ftp showing
> files in a single folder. No dir's needed. Anyone got a good idea how to do
> this?
>   
>>>>> Kenneth
>>>>>
>>>>> -----Original Message-----
>>>>> From: Niklas Gustavsson [mailto:niklas@protocol7.com]
>>>>> Sent: 19. mars 2010 14:43
>>>>> To: ftpserver-users@mina.apache.org
>>>>> Subject: Re: LIST from database
>>>>>
>>>>> On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com>
>>>>>           
> wrote:
>   
>>>>>> You should create your own FileSystemFactory  and set it in the
>>>>>>             
> DefaultFtpServerContext like this:
>   
>>>>>> context.setFileSystemManager(filesystemFactory);
>>>>>>
>>>>>>             
>>>>> Or you can set it on the FtpServerFactory. Or, you can configure it as
>>>>>           
> a bean in the Spring config.
>   
>>>>> /niklas
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>           
>>>>
>>>>
>>>>         
>
>
>
>   

RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
Sounds good, I'll probably have them by tonight then :-) Thank you.

Kenneth

-----Original Message-----
From: Brett Bergquist [mailto:brett@thebergquistfamily.com] 
Sent: 21. mars 2010 23:11
To: ftpserver-users@mina.apache.org
Subject: Re: LIST from database

I should have them sometime Monday.  They are at work and I am at home :)  I
ended up working all Saturday but not on this :(  I extracted the files out
to extract on their own and I just want to run a few tests and then I will
have them to post.

Brett

On Mar 21, 2010, at 5:00 PM, Kenneth Vanvik Hansen wrote:

> How are you doing with those files?
> 
> Kenneth
> 
> On 19. mars 2010, at 18.55, "Brett M. Bergquist"
<br...@thebergquistfamily.com> wrote:
> 
>> Give me a few hours and I will get the files together and provide them.
>> It turns out, I was not using JPA in the FTP side of things but put a JPA
interface on top of the database side to allow my web application to provide
an easy interface to list what was in the storage, delete files, etc. from a
Web page.  So the code is straight JDBC access that right now is targeted to
a Derby database, but nothing really special used from that.
>> 
>> Kenneth Vanvik Hansen wrote:
>>> Not using JPA at the moment, but i probably could if i wanted to. If 
>>> you could send me the files it might save me a lot of work. Using an 
>>> Oracle database, but I could probably make the required changes myself.
Thanks.
>>> 
>>> Kenneth
>>> 
>>> kvhansen@online.no
>>> 
>>> -----Original Message-----
>>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com] Sent: 
>>> 19. mars 2010 16:42
>>> To: ftpserver-users@mina.apache.org
>>> Subject: Re: LIST from database
>>> 
>>> Kenneth are you using JPA or can use JPA?  I have this implemented 
>>> in JPA and I could send you the files but they are not clean in that 
>>> they reference tables in my database, etc.  From the files, you 
>>> could extract what you need, however.  Or probably by Monday, I 
>>> could have this cleaned up enough to submit back.
>>> 
>>> Files are stored in the DB as blobs and I have 
>>> directory/subdirectory, list, put, get, and delete all working using
Derby as my target database.
>>> 
>>> Kenneth Vanvik Hansen wrote:
>>> 
>>>> Thanks, got it running. Now i'm trying to make it look for files in a
db table called FTPTEST. But no matter what I do it returns:
>>>> Java.io.FileNotFoundException: res\home\kenneth (Access is denied)
>>>> 
>>>> I created a file from a blob and returned it in getFile(), but how am I
supposed to make it LIST from the db? All I need atm is the ftp showing
files in a single folder. No dir's needed. Anyone got a good idea how to do
this?
>>>> 
>>>> Kenneth
>>>> 
>>>> -----Original Message-----
>>>> From: Niklas Gustavsson [mailto:niklas@protocol7.com]
>>>> Sent: 19. mars 2010 14:43
>>>> To: ftpserver-users@mina.apache.org
>>>> Subject: Re: LIST from database
>>>> 
>>>> On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com>
wrote:
>>>> 
>>>>> You should create your own FileSystemFactory  and set it in the
DefaultFtpServerContext like this:
>>>>> context.setFileSystemManager(filesystemFactory);
>>>>> 
>>>> Or you can set it on the FtpServerFactory. Or, you can configure it as
a bean in the Spring config.
>>>> 
>>>> /niklas
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> 
>> 



Re: LIST from database

Posted by Brett Bergquist <br...@thebergquistfamily.com>.
I should have them sometime Monday.  They are at work and I am at home :)  I ended up working all Saturday but not on this :(  I extracted the files out to extract on their own and I just want to run a few tests and then I will have them to post.

Brett

On Mar 21, 2010, at 5:00 PM, Kenneth Vanvik Hansen wrote:

> How are you doing with those files?
> 
> Kenneth
> 
> On 19. mars 2010, at 18.55, "Brett M. Bergquist" <br...@thebergquistfamily.com> wrote:
> 
>> Give me a few hours and I will get the files together and provide them.
>> It turns out, I was not using JPA in the FTP side of things but put a JPA interface on top of the database side to allow my web application to provide an easy interface to list what was in the storage, delete files, etc. from a Web page.  So the code is straight JDBC access that right now is targeted to a Derby database, but nothing really special used from that.
>> 
>> Kenneth Vanvik Hansen wrote:
>>> Not using JPA at the moment, but i probably could if i wanted to. If you
>>> could send me the files it might save me a lot of work. Using an Oracle
>>> database, but I could probably make the required changes myself. Thanks.
>>> 
>>> Kenneth
>>> 
>>> kvhansen@online.no
>>> 
>>> -----Original Message-----
>>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com] Sent: 19. mars 2010 16:42
>>> To: ftpserver-users@mina.apache.org
>>> Subject: Re: LIST from database
>>> 
>>> Kenneth are you using JPA or can use JPA?  I have this implemented in JPA
>>> and I could send you the files but they are not clean in that they reference
>>> tables in my database, etc.  From the files, you could extract what you
>>> need, however.  Or probably by Monday, I could have this cleaned up enough
>>> to submit back.
>>> 
>>> Files are stored in the DB as blobs and I have directory/subdirectory, list,
>>> put, get, and delete all working using Derby as my target database.
>>> 
>>> Kenneth Vanvik Hansen wrote:
>>> 
>>>> Thanks, got it running. Now i'm trying to make it look for files in a db table called FTPTEST. But no matter what I do it returns:
>>>> Java.io.FileNotFoundException: res\home\kenneth (Access is denied)
>>>> 
>>>> I created a file from a blob and returned it in getFile(), but how am I supposed to make it LIST from the db? All I need atm is the ftp showing files in a single folder. No dir's needed. Anyone got a good idea how to do this?
>>>> 
>>>> Kenneth
>>>> 
>>>> -----Original Message-----
>>>> From: Niklas Gustavsson [mailto:niklas@protocol7.com]
>>>> Sent: 19. mars 2010 14:43
>>>> To: ftpserver-users@mina.apache.org
>>>> Subject: Re: LIST from database
>>>> 
>>>> On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com> wrote:
>>>> 
>>>>> You should create your own FileSystemFactory  and set it in the DefaultFtpServerContext like this:
>>>>> context.setFileSystemManager(filesystemFactory);
>>>>> 
>>>> Or you can set it on the FtpServerFactory. Or, you can configure it as a bean in the Spring config.
>>>> 
>>>> /niklas
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> 
>> 


Re: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
How are you doing with those files?

Kenneth

On 19. mars 2010, at 18.55, "Brett M. Bergquist" <brett@thebergquistfamily.com 
 > wrote:

> Give me a few hours and I will get the files together and provide  
> them.
> It turns out, I was not using JPA in the FTP side of things but put  
> a JPA interface on top of the database side to allow my web  
> application to provide an easy interface to list what was in the  
> storage, delete files, etc. from a Web page.  So the code is  
> straight JDBC access that right now is targeted to a Derby database,  
> but nothing really special used from that.
>
> Kenneth Vanvik Hansen wrote:
>> Not using JPA at the moment, but i probably could if i wanted to.  
>> If you
>> could send me the files it might save me a lot of work. Using an  
>> Oracle
>> database, but I could probably make the required changes myself.  
>> Thanks.
>>
>> Kenneth
>>
>> kvhansen@online.no
>>
>> -----Original Message-----
>> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com]  
>> Sent: 19. mars 2010 16:42
>> To: ftpserver-users@mina.apache.org
>> Subject: Re: LIST from database
>>
>> Kenneth are you using JPA or can use JPA?  I have this implemented  
>> in JPA
>> and I could send you the files but they are not clean in that they  
>> reference
>> tables in my database, etc.  From the files, you could extract what  
>> you
>> need, however.  Or probably by Monday, I could have this cleaned up  
>> enough
>> to submit back.
>>
>> Files are stored in the DB as blobs and I have directory/ 
>> subdirectory, list,
>> put, get, and delete all working using Derby as my target database.
>>
>> Kenneth Vanvik Hansen wrote:
>>
>>> Thanks, got it running. Now i'm trying to make it look for files  
>>> in a db table called FTPTEST. But no matter what I do it returns:
>>> Java.io.FileNotFoundException: res\home\kenneth (Access is denied)
>>>
>>> I created a file from a blob and returned it in getFile(), but how  
>>> am I supposed to make it LIST from the db? All I need atm is the  
>>> ftp showing files in a single folder. No dir's needed. Anyone got  
>>> a good idea how to do this?
>>>
>>> Kenneth
>>>
>>> -----Original Message-----
>>> From: Niklas Gustavsson [mailto:niklas@protocol7.com]
>>> Sent: 19. mars 2010 14:43
>>> To: ftpserver-users@mina.apache.org
>>> Subject: Re: LIST from database
>>>
>>> On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com>  
>>> wrote:
>>>
>>>> You should create your own FileSystemFactory  and set it in the  
>>>> DefaultFtpServerContext like this:
>>>> context.setFileSystemManager(filesystemFactory);
>>>>
>>> Or you can set it on the FtpServerFactory. Or, you can configure  
>>> it as a bean in the Spring config.
>>>
>>> /niklas
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>

Re: LIST from database

Posted by "Brett M. Bergquist" <br...@thebergquistfamily.com>.
Give me a few hours and I will get the files together and provide them. 

It turns out, I was not using JPA in the FTP side of things but put a 
JPA interface on top of the database side to allow my web application to 
provide an easy interface to list what was in the storage, delete files, 
etc. from a Web page.  So the code is straight JDBC access that right 
now is targeted to a Derby database, but nothing really special used 
from that.

Kenneth Vanvik Hansen wrote:
> Not using JPA at the moment, but i probably could if i wanted to. If you
> could send me the files it might save me a lot of work. Using an Oracle
> database, but I could probably make the required changes myself. Thanks.
>
> Kenneth
>
> kvhansen@online.no
>
> -----Original Message-----
> From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com] 
> Sent: 19. mars 2010 16:42
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
>
> Kenneth are you using JPA or can use JPA?  I have this implemented in JPA
> and I could send you the files but they are not clean in that they reference
> tables in my database, etc.  From the files, you could extract what you
> need, however.  Or probably by Monday, I could have this cleaned up enough
> to submit back.
>
> Files are stored in the DB as blobs and I have directory/subdirectory, list,
> put, get, and delete all working using Derby as my target database.
>
> Kenneth Vanvik Hansen wrote:
>   
>> Thanks, got it running. Now i'm trying to make it look for files in a 
>> db table called FTPTEST. But no matter what I do it returns:
>> Java.io.FileNotFoundException: res\home\kenneth (Access is denied)
>>
>> I created a file from a blob and returned it in getFile(), but how am 
>> I supposed to make it LIST from the db? All I need atm is the ftp 
>> showing files in a single folder. No dir's needed. Anyone got a good 
>> idea how to do this?
>>
>> Kenneth
>>
>> -----Original Message-----
>> From: Niklas Gustavsson [mailto:niklas@protocol7.com]
>> Sent: 19. mars 2010 14:43
>> To: ftpserver-users@mina.apache.org
>> Subject: Re: LIST from database
>>
>> On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com> wrote:
>>   
>>     
>>> You should create your own FileSystemFactory  and set it in the 
>>> DefaultFtpServerContext like this:
>>>  context.setFileSystemManager(filesystemFactory);
>>>     
>>>       
>> Or you can set it on the FtpServerFactory. Or, you can configure it as 
>> a bean in the Spring config.
>>
>> /niklas
>>
>>
>>
>>   
>>     
>
>
>
>   

RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
Not using JPA at the moment, but i probably could if i wanted to. If you
could send me the files it might save me a lot of work. Using an Oracle
database, but I could probably make the required changes myself. Thanks.

Kenneth

kvhansen@online.no

-----Original Message-----
From: Brett M. Bergquist [mailto:brett@thebergquistfamily.com] 
Sent: 19. mars 2010 16:42
To: ftpserver-users@mina.apache.org
Subject: Re: LIST from database

Kenneth are you using JPA or can use JPA?  I have this implemented in JPA
and I could send you the files but they are not clean in that they reference
tables in my database, etc.  From the files, you could extract what you
need, however.  Or probably by Monday, I could have this cleaned up enough
to submit back.

Files are stored in the DB as blobs and I have directory/subdirectory, list,
put, get, and delete all working using Derby as my target database.

Kenneth Vanvik Hansen wrote:
> Thanks, got it running. Now i'm trying to make it look for files in a 
> db table called FTPTEST. But no matter what I do it returns:
> Java.io.FileNotFoundException: res\home\kenneth (Access is denied)
>
> I created a file from a blob and returned it in getFile(), but how am 
> I supposed to make it LIST from the db? All I need atm is the ftp 
> showing files in a single folder. No dir's needed. Anyone got a good 
> idea how to do this?
>
> Kenneth
>
> -----Original Message-----
> From: Niklas Gustavsson [mailto:niklas@protocol7.com]
> Sent: 19. mars 2010 14:43
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
>
> On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com> wrote:
>   
>> You should create your own FileSystemFactory  and set it in the 
>> DefaultFtpServerContext like this:
>>  context.setFileSystemManager(filesystemFactory);
>>     
>
> Or you can set it on the FtpServerFactory. Or, you can configure it as 
> a bean in the Spring config.
>
> /niklas
>
>
>
>   



Re: LIST from database

Posted by "Brett M. Bergquist" <br...@thebergquistfamily.com>.
Kenneth are you using JPA or can use JPA?  I have this implemented in 
JPA and I could send you the files but they are not clean in that they 
reference tables in my database, etc.  From the files, you could extract 
what you need, however.  Or probably by Monday, I could have this 
cleaned up enough to submit back.

Files are stored in the DB as blobs and I have directory/subdirectory, 
list, put, get, and delete all working using Derby as my target database.

Kenneth Vanvik Hansen wrote:
> Thanks, got it running. Now i'm trying to make it look for files in a db
> table called FTPTEST. But no matter what I do it returns:
> Java.io.FileNotFoundException: res\home\kenneth (Access is denied)
>
> I created a file from a blob and returned it in getFile(), but how am I
> supposed to make it LIST from the db? All I need atm is the ftp showing
> files in a single folder. No dir's needed. Anyone got a good idea how to do
> this?
>
> Kenneth
>
> -----Original Message-----
> From: Niklas Gustavsson [mailto:niklas@protocol7.com] 
> Sent: 19. mars 2010 14:43
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
>
> On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com> wrote:
>   
>> You should create your own FileSystemFactory  and set it in the 
>> DefaultFtpServerContext like this:
>>  context.setFileSystemManager(filesystemFactory);
>>     
>
> Or you can set it on the FtpServerFactory. Or, you can configure it as a
> bean in the Spring config.
>
> /niklas
>
>
>
>   

RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
Thanks, got it running. Now i'm trying to make it look for files in a db
table called FTPTEST. But no matter what I do it returns:
Java.io.FileNotFoundException: res\home\kenneth (Access is denied)

I created a file from a blob and returned it in getFile(), but how am I
supposed to make it LIST from the db? All I need atm is the ftp showing
files in a single folder. No dir's needed. Anyone got a good idea how to do
this?

Kenneth

-----Original Message-----
From: Niklas Gustavsson [mailto:niklas@protocol7.com] 
Sent: 19. mars 2010 14:43
To: ftpserver-users@mina.apache.org
Subject: Re: LIST from database

On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com> wrote:
> You should create your own FileSystemFactory  and set it in the 
> DefaultFtpServerContext like this:
>  context.setFileSystemManager(filesystemFactory);

Or you can set it on the FtpServerFactory. Or, you can configure it as a
bean in the Spring config.

/niklas



Re: LIST from database

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Fri, Mar 19, 2010 at 11:42 AM, David Latorre <dv...@gmail.com> wrote:
> You should create your own FileSystemFactory  and set it in the
> DefaultFtpServerContext like this:
>  context.setFileSystemManager(filesystemFactory);

Or you can set it on the FtpServerFactory. Or, you can configure it as
a bean in the Spring config.

/niklas

Re: LIST from database

Posted by David Latorre <dv...@gmail.com>.
2010/3/19 Kenneth Vanvik Hansen <kv...@online.no>:
> I've got a custom ( looks very much like the native one atm) filesystem
> implemented. Now I am wondering how to make the server use it. Figure I have
> to call setFileSystem() in FileSystemFactory somehow. Help? :)


You should create your own FileSystemFactory  and set it in the
DefaultFtpServerContext like this:
 context.setFileSystemManager(filesystemFactory);



> -----Original Message-----
> From: Kenneth Vanvik Hansen [mailto:kvhansen@online.no]
> Sent: 18. mars 2010 16:38
> To: ftpserver-users@mina.apache.org
> Subject: RE: LIST from database
>
> Nice one. No rush :-) Would be nice with a heads up when/if you get it done.
>
> -----Original Message-----
> From: Niklas Gustavsson [mailto:niklas@protocol7.com]
> Sent: 18. mars 2010 16:14
> To: ftpserver-users@mina.apache.org
> Subject: Re: LIST from database
>
> On Thu, Mar 18, 2010 at 4:02 PM, Kenneth Vanvik Hansen <kv...@online.no>
> wrote:
>> Would be really nice. Have searched for info on it but can't say I've
>> found any. I'm not sure how I'm supposed to start doing this so I
>> might just go ahead with replacing the LIST command like my first idea
> was.
>
> I will have a go at writing such an example implementation, but don't hold
> your breath, it might take a few days or so.
>
> /niklas
>
>
>
>

RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
I've got a custom ( looks very much like the native one atm) filesystem
implemented. Now I am wondering how to make the server use it. Figure I have
to call setFileSystem() in FileSystemFactory somehow. Help? :)

-----Original Message-----
From: Kenneth Vanvik Hansen [mailto:kvhansen@online.no] 
Sent: 18. mars 2010 16:38
To: ftpserver-users@mina.apache.org
Subject: RE: LIST from database

Nice one. No rush :-) Would be nice with a heads up when/if you get it done.

-----Original Message-----
From: Niklas Gustavsson [mailto:niklas@protocol7.com]
Sent: 18. mars 2010 16:14
To: ftpserver-users@mina.apache.org
Subject: Re: LIST from database

On Thu, Mar 18, 2010 at 4:02 PM, Kenneth Vanvik Hansen <kv...@online.no>
wrote:
> Would be really nice. Have searched for info on it but can't say I've 
> found any. I'm not sure how I'm supposed to start doing this so I 
> might just go ahead with replacing the LIST command like my first idea
was.

I will have a go at writing such an example implementation, but don't hold
your breath, it might take a few days or so.

/niklas




RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
Nice one. No rush :-) Would be nice with a heads up when/if you get it done.

-----Original Message-----
From: Niklas Gustavsson [mailto:niklas@protocol7.com] 
Sent: 18. mars 2010 16:14
To: ftpserver-users@mina.apache.org
Subject: Re: LIST from database

On Thu, Mar 18, 2010 at 4:02 PM, Kenneth Vanvik Hansen <kv...@online.no>
wrote:
> Would be really nice. Have searched for info on it but can't say I've 
> found any. I'm not sure how I'm supposed to start doing this so I 
> might just go ahead with replacing the LIST command like my first idea
was.

I will have a go at writing such an example implementation, but don't hold
your breath, it might take a few days or so.

/niklas



Re: LIST from database

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Thu, Mar 18, 2010 at 4:02 PM, Kenneth Vanvik Hansen
<kv...@online.no> wrote:
> Would be really nice. Have searched for info on it but can't say I've found
> any. I'm not sure how I'm supposed to start doing this so I might just go
> ahead with replacing the LIST command like my first idea was.

I will have a go at writing such an example implementation, but don't
hold your breath, it might take a few days or so.

/niklas

RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
Would be really nice. Have searched for info on it but can't say I've found
any. I'm not sure how I'm supposed to start doing this so I might just go
ahead with replacing the LIST command like my first idea was.

-----Original Message-----
From: Niklas Gustavsson [mailto:niklas@protocol7.com] 
Sent: 18. mars 2010 15:14
To: ftpserver-users@mina.apache.org
Subject: Re: LIST from database

On Thu, Mar 18, 2010 at 2:53 PM, Kenneth Vanvik Hansen <kv...@online.no>
wrote:
> Thanks, looking at it now. Know of any examples using FileSystemView?

The only one we got is our NativFileSystemView. But I know other users has
asked about database backed file systems here before, so there might be
other which have examples. Perhaps we should write an example since it's a
frequent question?

/niklas



Re: LIST from database

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Thu, Mar 18, 2010 at 2:53 PM, Kenneth Vanvik Hansen
<kv...@online.no> wrote:
> Thanks, looking at it now. Know of any examples using FileSystemView?

The only one we got is our NativFileSystemView. But I know other users
has asked about database backed file systems here before, so there
might be other which have examples. Perhaps we should write an example
since it's a frequent question?

/niklas

RE: LIST from database

Posted by Kenneth Vanvik Hansen <kv...@online.no>.
Thanks, looking at it now. Know of any examples using FileSystemView?

-----Original Message-----
From: Niklas Gustavsson [mailto:niklas@protocol7.com] 
Sent: 17. mars 2010 22:06
To: ftpserver-users@mina.apache.org
Subject: Re: LIST from database

On Wed, Mar 17, 2010 at 2:39 PM, Kenneth Vanvik Hansen
<kv...@online.no> wrote:
> Hi, i have written an ftplet that puts a file and file info in a database
> table. Now I need to get LIST to list information from the database. I was
> wondering if something like this has been done before? Would save me some
> time if someone had any solutions/ideas.

Sounds like what you want is a custom file system implementation,
backed by your database. If you implement that, all commands will work
as normal.

/niklas



Re: LIST from database

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Wed, Mar 17, 2010 at 2:39 PM, Kenneth Vanvik Hansen
<kv...@online.no> wrote:
> Hi, i have written an ftplet that puts a file and file info in a database
> table. Now I need to get LIST to list information from the database. I was
> wondering if something like this has been done before? Would save me some
> time if someone had any solutions/ideas.

Sounds like what you want is a custom file system implementation,
backed by your database. If you implement that, all commands will work
as normal.

/niklas