Results 1 to 3 of 3

Thread: ZIP file support?

  1. #1

    Default ZIP file support?

    I know this is more of an application design question which I should probably figure for myself and not related to the framework per se, but I will throw it out anyway.

    Our application has a functionality to allow the download of catalogs in ZIP format. These catalogs will have items that the user selected while browsing and added to their shopping cart. Now, what is common in these catalogs is the images, css etc that make up the 'chrome' and look & feel of the catalog.

    What I want to do is use Spring to create the common ZIP file with all common stuff on server start-up and then clone this zip file for each user who wants to add items to their cloned ZIP for download. This will avoid everytime reading the files from the filesystem and creating the zip for every user that wants to download one or more items.

    Does anyone see any issue using the bean factory to do this? How would you approach it?

    Anyway, again I know it is not framework related so no need to respond. I'll delete the post if no response. Thank you.

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    You can create a FactoryBean: ZipFactory. The first call to ZipFactory.getObject() will create the common ZIP file. I can see here two scenarios:
    1. ZipFactory.getObject() returns the ZIP file path: ZipFactory.isSingleton() returns true
    2. ZipFactory.getObject() returns a clone of the common ZIP file: ZipFactory.isSingleton() returns false.
    I think using FactoryBean is a good choice as you can rely on Spring DI to inject parameters to your ZipFactory (temporary path, ...).
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3

    Default

    Thanks Omar for summing it up. I really wanted to use the DI portion of the framework for this since I think it will be much cleaner and easier to maintain the contents of the ZIP file.

Similar Threads

  1. Replies: 5
    Last Post: Mar 17th, 2010, 04:32 AM
  2. Deferred file upload
    By Thomas Matzner in forum Web
    Replies: 4
    Last Post: Sep 30th, 2005, 12:06 PM
  3. Just JDBC support (newbie guy)
    By garcima in forum Data
    Replies: 5
    Last Post: Dec 9th, 2004, 10:26 AM
  4. Replies: 2
    Last Post: Nov 15th, 2004, 07:22 PM
  5. iBatis 2 Support - Can't locate sqlmap config file
    By roneisele in forum Container
    Replies: 5
    Last Post: Aug 29th, 2004, 10:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •