Caching a file as ByteArrayInputStream/ByteArrayOutputStream object

- I am keeping a set of files in session as ByteArrayStream objects.
- Based on the user's request respective file/files is/are zipped and downloaded.
- First time I download, I am getting the file size and file correctly. But if I make a repeat filedownload request I am noticing the file size is zero bytes.
I am guessing this is bcoz the ZipOutputStream(wrapper to OutputStream)is empty as I have made request for that.
How can I make the streams available until the session expires? I would like to prevent reading the same files per request from database. Instead, I would like to read and keep them in cache.
How can I achieve this?
Thanks in advance to all the reviewers.

You don't keep streams, they are single-use. Keep the byte[] instead and create a new ByteArray...Stream each time the contents of the file are requested.

Similar Messages

  • How does Flex cache PDF files??

    I need to prevent my Flex application to cache PDF files... We are using LiveCycle8.2 and Flex 3.2. Does anybody may help me??

    Sorry for being newbie obtuse but are you saying that FP (Flex Project I assume)'s are an Active X (application) and thus IE does utilize its cache for all HTTP based communications???
    If so then as I understand it, the typical Flex Project has an HTML wrapper which then loads the Flex App (I assume using HTTP).  Subsequent Flex<--->Server communications can be HTTP or other format (AMF which I believe BenForta indicated was HTTP "wrapped" as well but at the moment I am less concerned with this).
    As such is the following correct?
    1.)  IE Browser hits HTML page (url) ----> IE checks its cache; If exists compares vs current version on server; If different download from server else load from cache
    2.)  HTML page calls Flex App (using HTTP???) ----> IE again compares Flex App in cache (if exists) vs. server and if same load else download
    3.)  Flex App retrieves image file names via <mx:RemoteObject> ----- I don't see how browser cache can be used here as results not known until after dbase query completes
    4.)  Flex App uses <mx:RemoteObject> results to retrieve large .jpg files  ---- do these "pass through" the browser (and therefore load and/or store in cache) or are they purely "Flex contained" (and if so does flex have any automatic cache or do I have to perhaps store the jpgs in a shared object if I hope to reuse them without a download)???

  • Adobe flash cache/temp files

    Hi,
    Where is are the cache/temp files for adobe flash files? I
    downloaded an game in SWF and have certain levels saved. When I
    move the SWF to a new computer, I am unable to transfer those
    levels and suspect that whenever I play the game, it is storing the
    files in temp/cache. Any advice?

    most likely the Developer is using Shared Objects to remember
    what the progress is.. search your computer for .sol and if it
    returns anything, then that is the file you are looking for.. it
    will need to be relative to the SWF if you move it around though,
    making sure it is in the same spot as original, because that will
    be how the SWF is looking for it.

  • Who knows where does IE6 cache jar files?

    who knows where does IE6 cache jar files?
    I don't know why IE6 can't show my new version applet in jar file.I have try to delete all the temporary file by use tools->options->delete temporary files.but it does't work.who can tell me what should i do? thank you,

    Well in that case...I would hope it was cached in the browser...did you look at objects in the cache in (Tools, Internet Options....) in IE?

  • How do I stop automatic placement of files as a smart object in Photoshop CS4?

    I have done numerous searches on the internet to find out how to stop Photoshop from placing files as a smart object. I followed the suggestion of going to Edit > Preferences > General to uncheck the "Place or Drag Raster Images as Smart Obejct" but that option does not appear in Photoshop CS4. Does anyone know how to deal with this issue in CS4?

    This may sound strange, but to avoid the "Smart Object" designation, just stop "placing" the files. Either open them, or copy and paste them into Photoshop.
    If you're just opening raster files in Photoshop, they come in as pixels - drag a newly opened raster file onto your target Photoshop file. If you're copy/pasting art from Illustrator, you can choose at the time whether it is a "Smart Object," or "Pixels." Sounds like you want pixels.

  • Why has my Adobe PCD cache.db file size started growing suddenly

    I am running CS4 Design Premium on an iMac which had OS X 10.6.2 until the 29th and now has 10.6.3.
    On 19th March my Adobe PCD cache.db file size was just over 100Mb. Since then it has grown steadily until it is now over 19Gb in size.
    Can anyone explain to me why it should suddenly have started growing please? During this time I have really only run Acrobat Pro; however I have had a lot of browser (Safari and FF) hangs/crashes due to Flash plugin issues.
    I understand the cache.db also holds licence information so is it safe to delete this file? If so will I need to reenter my license information?
    Any help would be appreciated. Thanks
    Phill

    I have the same problem.
    My pcd.db file is now 56 GB
    What is going on !?!?!?
    Sikem

  • Bridge Unable to Cache Ai Files

    I have hit a problem with Bridge CC (6.0.1.6) freezing when I selected a folder containing both Illustrator CC (17.1.0) .ai and exported .png files.  Bridge would report that it was 'Building Criteria' and the spinning circle would be active in the bottom left corner.  It would sit like this for hours despite the folder only containing a dozen files. The only why to recover the situtation in to force quit Bridge; the Force Quit dialog DID NOT report that Bridge was not responding.
    I have this morning used Finder to separate the .ai and .png into separate folders.  After this Bridge was able to access and cache both folders without problem or delay.

    Well, i faced this error "unable to cache" once before and the reason was that jar files which need to be cached at client side had not timestamp assigned to them on my linux system where application server was installed, the reason which i came to know was that i coppied them from a windows system. To resolve this problem at that time, i coppied them on my linux server and then pasted again there and this time my linux server generated TIMESTAMP for my those files and it started working fine.
    This time i really didnt know what happend but now i am gona tell you a strange story. If i use http://rg:1810 (in firefox browser) i can see admin page of my application server control and if i use http://rg.lhr.systemsltd.com:1810, it displays error "Time out ouucred......" (This kind of error).
    But inter explorer doesn't report any error and works fine.
    now in my error message you can see that first APPLET goes to "http://rg.lhr.systemsltd.com:7779/forms90/java/webutil.jar" to cache the file and as this is using a fully qualified name of my server so it is unable to find that server as MOZILA did and returned connection time out type of error message.
    Now i changed the server name and then did a fresh installation and it started working fine. It means there is some problem with my DNS which is causing application applet could not find files if fully qualified name of server is used.
    regards

  • How can i return a file as a Tranferable object

    This method bundles up the data to be exported into a Transferable object in preparation for the transfer.*My requirement is to transfer a file as a object.* Here in example it returns a string. So i would like to know how can
    we code to transfer a file( NOT FILE NAME).
    Example:-
    protected Transferable createTransferable(JComponent c) {
    // cast component in JList
    JList list = (JList)c;
    // Get collect the values that have been currently selected
    Object[] values = list.getSelectedValues();
    StringBuffer buff = new StringBuffer();
    for (int i = 0; i < values.length; i++) {
    Object val = values;
    buff.append(val == null ? "" : val.toString());
    if (i != values.length - 1) {
    buff.append("\n");
    return new StringSelection(buff.toString()); // Return as a string
    My Requirement:- So here we are doing
    protected Transferable createTransferable(JComponent c) {
    JXTable table = (JXTable)c;
    int row = table.getSelectedRow();
    int col= table.getSelectedColumn();
    *// Here we get the absolute path of file. i.e C:\Ashish.txt from   Table's selected cell*
    Object value=table.getValueAt(row,col);
    *// Here we access that file with location*
    File file = new File(value);
    *// And now i want to transfer that file as a Transferable object*
    return ( file ); // Need to return a file(NOT FILE NAME)
    In above procedure i would not able to return a file as a object. Please suggest me. Thanks in advance.
    Ashish Pancholi

    Thank you very much for your valuable advice.I am in need of one more help.......
    As i am on task to do resize window of my JAVA API and drags a file from JXTable and drop it to my desktop OR any where in file system then it should be copy their.
    But i am getting to difficulties
    *1> As i start a file to drag and cross the edge of my JAVA API..cursor of mouse is showing be Symbol of DefaultCopyONDrop (/) something like that.*
    *2> I sincerely need a absolute path of location where i have released my mouse to drop so that i can copy that file their.*
    So can you please help me know the solution of these two difficulties. I want file system to accept my file which i am dragging and need location to copy file. Once again thanks in advance.

  • Can you please help to understand how the firefox decides on the Expires date for a cached javascript file ( my server did not set any Expire header, but firebox set it down).

    # Question
    Can you please help to understand how the firefox decides on the Expires date for a cached javascript file ( my server did not set any Expire header, but firebox set it down). I tried to understand but different javascript file gets different Expires date value when it is being cached. Please help me as I tried lot and could not get proper answer for this. Thanks in Advance.

    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br />
    http://forums.mozillazine.org/viewforum.php?f=25 <br />
    You'll need to register and login to be able to post in that forum.

  • File to File Interface without ESR objects

    Hello everyone,
    I have a requirement where our business users will  produce the .csv files in one location and we need to move to another location.
    I recon that we can build this File to File interface( usin FCC) without using ESR objects, can any one help me with the procedure since i am new to PI.  
    Thanks in advance

    HI Chandrika ,
    File to File Interface without ESR objects
    this is very simple , you need to create Configuration objs
    1. sender Communication channel and agrrenment
    2. receiver Communication channel and agrrenment
    3. u have to provide dummy service interface names and name space in interface determination,
    4.in receiver determination , we have to provide source and receiuvers bu.components and remaining dummy names.
    thanks,

  • How do I retrieve cache.mov files so I can play them on quicktime?

    Hi, I've recently been deleting files to free up harddisk space and have come upon some cache.mov files. These are videos I regret deleting and have no backups of. When I get info on them if shows the video in the preview, but if I try to open it in Quicktime or VLC it won't play. Is it possible to save these files and get them to play on Quicktime?

    Please try the following program (Free iPod Video Converter freeware). I have converted several Windows Media files to the .mp4 format which iPod will play. And it's free. http://www.jodix.com/. Good Luck
      Windows XP  

  • How to clear cache, temporary files, cookies in Firefox five

    how do I go about clearing the cache, temporary files, and cookies in the new version of Firefox five. The tools and techniques in the old menu bar were developed over many years and are useful to some people some of the time. When you make major changes and take away useful tools he often cause frustration amongst your users.

    You can go to Tools -> Clear Recent History (or Ctrl+Shift+Del) and choose what you want to delete.
    Or you can take the long way through Tools -> Options -> Privacy and click on "clear your recent history"
    Hope this helps

  • Applet Plug-in and Caching GIF files

    In the Plug-in 1.4 release notes, it says that the Plug-in will cache GIF files and other non-JAR files. Are there instructions or documentation how to get the Plug-in to cache files other than JAR files? I couldn't find anything when perusing the 1.4 documentation.
    Thanks for any insight you can provide!

    The document you point to explains caching JAR files in 1.3. Can I also cahce GIF files the same way? Does the plug-in caching mechanism work with any file type? If I cache a GIF file, how to I reference that in my code so the Applet uses the cached version instead of the one on the server, or does it implicitly know this?
    Thanks for any insight.

  • Split cache config file support in 12.1.2?

    With 3.7.1 you could use the coherence-common library from incubator 11 to split cache config files.
    This was done with the introduce-cache-config XML element:
    <?xml version="1.0"?>
    <cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
    xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd"
    xmlns:element="class://com.oracle.coherence.environment.extensible.namespaces.XmlElementProcessingNamespaceContentHandler"
    element:introduce-cache-config="cache-config-1.xml, cache-config-2.xml, cache-config-3.xml">
    </cache-config>
    But this will not be available in incubator 12, the classes used for that will not be ported from incubator 11 (Coherence 3.7.x) to incubator 12 (Coherence 12.x):
    http://coherence.oracle.com/download/attachments/14188570/Incubator+Update.pdf?version=2&modificationDate=1353937318977
    How to achieve this with 12.1.2?

    Hi,
    It is still possible to do this as I did it with the 12.1.2 beta and a beta of Incubator 12 so unless either of those changed at the last minute you should be able to still import cache configuration files.
    The top of your XML needs to look something like this...
    <?xml version="1.0"?>
    <cache-config xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
                  xmlns:element="class://com.oracle.coherence.common.namespace.preprocessing.XmlPreprocessingNamespaceHandler"
                  element:introduce-cache-config="config/cluster.xml">
    where this file is importing the "config/cluster.xml" file.
    If you use custom name spaces in you configuration files then there is a bit more work to do as the XmlPreprocessingNamespaceHandler only knows how to merge the standard Coherence XML so you need to add extra code to you own namespace handlers. Specifically you need to implement...
    public void mergeConfiguration(ProcessingContext processingContext, String sFromURI, XmlElement element, XmlElement xmlIntoCacheConfig, QualifiedName originatedFrom)
    In the implementation you need to merge your custom XML (the element parameter) across to the main XML (the xmlIntoCacheConfig parameter). A very simple implementation of this would be...
    @Override
    public void mergeConfiguration(ProcessingContext processingContext, String sFromURI, XmlElement element, XmlElement xmlIntoCacheConfig, QualifiedName originatedFrom) {
        // clone the element to merge
        XmlElement xmlMergeElement = (XmlElement) element.clone();
        // annotate the origin of the merging element
        xmlMergeElement.addAttribute(originatedFrom.getName()).setString(sFromURI);
        // Add the cloned element to the XML configuration
        xmlIntoCacheConfig.getElementList().add(xmlMergeElement);
    JK

  • How to make Edge Animation works in HLTM5 Offline? I cache all files, but Edge didn't play.

    How to make Edge Animation works in HLTM5 Offline? I cache all files, but Edge didn't play.
    Some createJS animation start without any problem.
    Thanks!
    Astors

    Thank you for your answer.
    I do use cdn off for publish setting.
    The Web site that I am working on is a very complicated site. Edge
    animations are in a subdirectory of Apache server.
    When server is offline, I get all files from Appcache without problem,
    excepted *_EdgePreload.js.
    I Google hundreds time, cannot find answer on why this file is always get
    online.
    Finally, I find out myself, Adobe Edge don’t like relative file path for
    *_EdgePreload.js.
    Change to root absolute path fixed the problem:
    Astors

Maybe you are looking for