I did not see a File object in Turbine..only the FileItem. Is this using
the File Object with java.io?

-----Original Message-----
From: Jeffery Painter [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 17, 2003 9:16 AM
To: Turbine Users List
Subject: Re: Using Turbine to delete a file....



I handle it this way... I'm still using TDK 2.1 but this should work for

you.


    public void doDelete(RunData data, Context context)
        throws Exception
    {
        Criteria criteria = new Criteria();

        // uploaded file entry is stored in the database, retrieve with
        // details to path of file on system
        criteria.add(PortfolioPeer.PORTFOLIO_ID,
data.getParameters().getInt("portfolioid"));

        // clean up the file from our local file system
        Portfolio entry = (Portfolio)
PortfolioPeer.doSelect(criteria).elementAt(0);

        File f = new File( TurbineServlet.getRealPath(
entry.getImageName() ) );
        if (f.exists()) {

                // perform the delete operation
                f.delete();

        }

        // remove database entry of file information
        PortfolioPeer.doDelete(criteria);

    }


HTH,
Jeff Painter


On Tue, 17 Jun 2003, Wilson, Allen wrote:

> Good morning...
>  
> I am deploying the Jetspeed Portal system for my company and one of
the
> things I am working on is a  File Transfer system for clients to
upload
> and download files. I have the upload working fine using the
> turbine.util.upload.FileItem. 
>  
> My problem comes when I want to provide the functionality for the user
> to delete an upload file. I found a the deleteFile method as part of
the
> FileHandler class but it says that the method has been deprecated for
> the TurbineUploadService counterpart FileItem. I looked up this class
> (or at least thought I did) but could not find any reference for
> deleting a file. Could someone provide some insight or direction on
> which method/class/object to use to delete a file.
>  
> Thanks.....Allen
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

This message may contain proprietary or confidential company information.
Any unauthorized use or disclosure is prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to