Unable to delete the file. (Some times deletes and sometime fails to delet)

Please help me in deleting the file from the temporary location .
Below is my code
//Append the session is with filename as there is possibility of having same name of file.
try{
boolean isMultipart     = ServletFileUpload.isMultipartContent(request);
          if (isMultipart)
               // Create a factory for disk-based file items
               factory = new DiskFileItemFactory();
                        // Create a new file upload handler
               upload = new ServletFileUpload(factory);
               // Parse the request
                  List /* FileItem */ items = upload.parseRequest(request);
                       // Process the uploaded items
               Iterator iter = items.iterator();
if(strInputFileName.lastIndexOf("\\")== -1)
     strInputFileName = (String)mPropBag.get("TempUploadDirM") + strInputFileName;
  }else
     strInputFileName = (String)mPropBag.get("TempUploadDir") +   strInputFileName.substring(strInputFileName.lastIndexOf("\\"));
strInputFileName = strInputFileName + "_" + request.getSession().getId();
uploadedFile     = new File(strInputFileName);
item.write(uploadedFile);  //// I am Writing the file in this location appened with the session Id because there might //be a  possibility of having same name of file.
catch(......)
finally
     uploadedFile.delete();
     uploadedFile = null;
     upload = null;
}I am unable to delete the file from the temporary location
some times it is deleting and some times it is not deleting.. I have also tried ...deleteOnExit();

Make sure you've got no other processes holding onto it (Windows Explorer, for instance) and that you've closed any streams involved with the file. If that fails, try calling System.gc() just before deleting the file. This is a workaround for a bug in certain JVMs on Windows machines

Similar Messages

  • Can I delete the files in ~/Library/Preferences and have all preferences reset to factory default?

    I have this folder inside my /Library folder called Preferences. I was wondering if I could delete all of the files inside this folder and have all of my preferences reset to the factory default?

    First, why would you want to do this? I ask because all of the applications installed also have preference files. Some of the preference files store things like serial numbers. Some programs that use plugins that use serial numbers also store the serial numbers in the host program's preference file. RapidWeaver is an example of this.
    So, If you deleted all of the files in your preference folder, you could have some major headaches for a while afterward.
    If you are curious, there is a program called AppleJack that only runs in Single User mode. It can check preference files for you. There are several others available that cost money. AppleJack is a free open source application.
    Hope this helps,
    Craig

  • I have my download list but I deleted the file on my computer and want it back, is there a way of using the list to get it back?

    I have the download list for firefox but accidentally deleted the file on my computer. I need the file and was wondering if there was a way of using the download list to access the file somehow, I don't think the file os on the internet either as I haven't found it

    Hello!<br>
    Go to the downloads window, right-click, and click "copy download link" or "go to download page". You should then be able to re-download it only if it's still in the downloads window

  • Disk space is full and I need to move and back up some movies to clear up space--suggestions?  I have a time capsule, but am afraid that if I delete the files from my laptop, they will subsequently be deleted from the time capsule.

    I also don't want to have a single copy of the movies.  Is buying an external hard drive for my movie files the only option?  Can I then use the time capsule to back-up the G Drive?
    Trish

    You can't depend on a Time Machine backup keeping copies of files that you've deleted from your Mac.  For one thing, those would be the only place those files were kept.  If the disk in the Time Capsule fails, you'd have lost them entirely.  For another thing, Time Machine will eventually delete those files.  See item 20 of Time Machine FAQs.
    A locally-connected external disk would be the best place to move those movies.

  • Chnfind unable to find the decimal type by variable and sometimes "Round" command

    Dear all,
    During the work with Diadem I got two troubles. Could you please take a look and show me the wrong if you find the issue?
    1.) Here is my trouble as we see the photo below. It is most important problem which I have. I really have no idea why it could happened. It is alway happened to find a value with decimal type's variable, and even that variable is changed  to "str()".
    setlocale("en-gb")
    dim Min_point,Index_low,result
    Min_point=val(Data.Root.ChannelGroups(1).Channels("CopyYangle").Properties("minimum").Value)
    Min_point=round(Min_point,6)
    Min_point=str(Min_point)
    msgbox("The Min.Value is: "&Min_point)
    Index_low=Chnfind("ch(""CopyYangle"")<="&Min_point&"", 1)
    msgbox("Index No. of Min. Value is: "&Index_low)
    Index_low=Chnfind("ch(""CopyYangle"")<=-0.11374 ", 1)
    msgbox("Index No. of Min. Value is: "&Index_low)
    2.) Still the problem with ChnFind()  or  ChnFindreverse().   If I change the Rounds off a number to the nearest integer with the function "Round()" it might not work in ChnFindreverse(). Such like it works under 4, 6, 8 and even 7 but doesn't work with 3 and 5. Is this logical?
    setlocale("en-gb")
    Dim XE, Xchannel, Ychannel,round_N0
    Xchannel = "[2]/Right"
    T1 = Xchannel
    R1 =val(Data.Root.ChannelGroups(2).Channels("Right").Properties("maximum").Value)
    round_N0=4 ' <========= 3 and 5 Not work, 4, 6, 7, 8 .... work
    R1 =round(R1,round_N0) ' <=========
    msgbox("Max. point is: " &R1 &VbCrlf& "Round Nr is: "&round_N0)
    L1 = ChnFindReverse ("Ch(T1)>=R1",0)
    msgbox("Index number for Max.Point is: "&L1 &VbCrlf& "Round Nr is: "&round_N0)
     .tdx is a valid extensions for an attachement?
    If you couldn't open the TMD file. Please remove ".tdv" the attacments file name to make sure it is "ChnFind.tdx" but not "ChnFind.tdx.tdv".
    Kind regards / Mit freundlichen Grüßen
    J.Huang
    Attachments:
    ChnFind.TDM ‏5 KB
    ChnFind.tdx.tdv ‏39 KB

    Hello J.Huang,
    I downloaded the files and was able to get it to work. It looks like when you format the minimum value to a string, you loose precision and then ChnFind doesn't find the value your are looking for. He is an example which worked for me :
    Set oChnY = Data.Root.ChannelGroups(2).Channels("Right")
    sgValue = str(oChnY.Properties("minimum").Value,"d.ddddddddddddddd")
    Index = ChnFindReverse("Y<="&sgValue,,Array("Y"),Array(oChnY))
    LogFileWrite(Index)
     Using symbols (parameters 3 and 4) is not necessary to get the solution. The key is teh second value for "str" which formats using more digits. As soon as you reduce the number of digits, you may no longer get a result.
    Ther is an alternative to ChnFind, in case there is only one occurance in teh signal which has the minimum value
    Set oChnY = Data.Root.ChannelGroups(2).Channels("Right")
    Index = PNo(oChnY,oChnY.Properties("minimum").Value)
    LogFileWrite(Index)
     I hope one of the two options works for you. I tested the approach with teh first channel too and it worked as well

  • How can i completely delete a file that i already deleted. i downloaded an app in the apple store and after deciding for quite some time i decided to delete the file from my phone. and find out that the download file is still there and cant delete it.

    guys hele me please..

    If you would like to contact one of the UK based BT Care Team who moderate this forum, they should be able to help you.
    They can be contacted using this link BT Care Team
    They normally respond by phone or e-mail, within three working days, however you should get an immediate confirmation, with a tracking number.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • If I put my music onto iCloud can I delete the files from my iPhone and stream the music?

    And if I do, will the quality be as good?

    The answer is yes and no. If you are using the free iCloud services then the answer is no, it only serves as a backup for you phone, iPod, etc. However, if you use iTunes Match which costs 20 some dollars a year (I believe) you can stream your music from the cloud as well as videos. How that works? I do not know, I just knot that's one if the features with iTunes Match.

  • Pressing command-z deletes the files even if there is no restore location

    I have copied some photos from sd card to my mac. Then I deleted the files from sd card and removed it to take more photos. While my friend was taking pictures somehow accidently I pressed the command-z. Then whole folder just disappeard. I didn't even get any notification that telling me "cannot find restore location" or " files will be deleted". Folder just disappeared in 1 second. They are not in the trash also.
    Where did they go? Are they in some sort of temporary storage? How can I get them back?
    SD Card is already full with other images so recovery program couldn't bring the old files back. Recovering on the computer might take so long time since I have 500gb hard drive. Is there a fast way to get files back?

    I cannot try it now for that folder since i did other copy oparations. But I did it with another file to try. I copied file from usb drive. Then I removed my usb drive and pressed command-z. File disappeared then I pressed command+shift+Z. A notification popped up "The operation can't be completed because it isn't supported". 

  • I am not able to display or change the file after deleting the file

    Hi All,
    I am checking in the document to content category while creating the DIR.
    I tried to delete the file on my desktop and after i am unable to open the file in CV02N,It gives the below error:
    Error while executing "C:\
    Firdosi\Desktop\gg.txt"
    I changed the settings in define workstation applications also and i ticked on Data check of.
    Please advice.
    Muzamil

    Hi Muzamil,
    The error is occuring because you have not checked-in the document before deleting. First you need to save the DIR and then you can delete the file from your desktop. Then only SAP DMS can retrieve the file from content server and display on screen.
    If you have only selected the file which is not checked-in means DIR not saved. And suddenly you tried to delete the original file from desktop. It means the recod is not saved in SAP DMS and before that you have tried to delete it.
    This is standard behaviour and such type of files can't be retrieved from content serever as it's original is not saved properly i.e. checked-in.
    Hope this will resolve the query.
    Regards,
    Ravindra

  • Delete the file from AL11

    hi all,
    how to delete file from application server(al11)?
    apart from using EPS_DELETE_FILE
    and writing a code  any other go to acheive it
    regards
    venkat

    Hi,
    AL11 is a tool to view files that exist on the operating system of the SAP instance (which I think is Rainer's point). 
    The only way to delete this files is either programatically (with the function module you mention or other ways) or to log onto the operating system directly and delete the file.  In either case you are not deleting them from AL11, you are deleting them from the operating system.
    Regards,
    Nick

  • How can i restore the files which are important to me which i suddenly delete the files in download?

    i nid to restore the file which i suddenly delete in download.. i was about to delete the files which are not important but i suddenly delete the files which are important... how can i restore it??

    Check the Windows recycle bin, you may be able to recover the files from there. Right-click on the recycle bin icon on the desktop and select Open. This will open Explorer, if the files are listed there, right-click on them and choose Restore.
    If the files are not in the recycle bin, you can try a file recovery utility such as recuva - http://www.piriform.com/recuva

  • Firefox won't re-install, saying that it's running. I was trying to delete the files manually.

    I tried re-installing firefox and it wouln't let me, saying that i had to close it first. so i tried to manually delete the files instead of uninstalling and now nothing works.

    Reboot the computer. That will close everything.
    '''[http://www.mozilla.org/en-US/firefox/all/ Download Firefox Full Installer For All languages And Systems]''' {web link}
    Save the file. Then;
    Using your file browser, open the '''Programs''' folder on your computer.
    '''Windows:''' C:\Program Files
    C:\Program Files (x86)
    '''Mac:''' Open the "Applications" folder.
    '''Linux:''' Check your user manual.
    Look for, and rename any Mozilla and Firefox folders by adding '''.old''' to them.
    Now run the full installer.
    If all goes well, remove the OLD folders when you are done.

  • I followed your help directions on "Corrupt extension files" under "Unable to install add-ons", foolishly deleting the files you told me to. Now firefox won't open. I tried reinstalling firefox but it still won't open. Now what do I do?

    I was trying to install the SEOQuake add on. After clicking install Firefox would hang up saying the script had timed out and asking if I want to stop it or continue. Didn't matter which option I chose nothing would happen. The only way to stop it was to close Firefox and restart. Tried restarting the computer. Still wouldn't install. Tried installing the Outwit add on and got the same error leading me to conclude it was a problem with Firefox, not the add on. I found this help page <http://support.mozilla.com/en-US/kb/Unable+to+install+add-ons?s=addons+won't+install&as=s> and did everything it told me to. Finally at the end I got to "Corrupt extension files". I foolishly deleted the files you told me to and now Firefox won't even start! I tried reinstalling Firefox and it still won't start. Tried restarting the computer. I have no idea how to get back to where I was let alone install the add ons I wanted to install. Please help. At this point I'd just be happy to be able to get Firefox working.

    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    Create a new profile as a test to check if your current profile is causing the problems.<br />
    See [[Basic Troubleshooting#Make_a_new_profile|Basic Troubleshooting&#58; Make a new profile]]
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)<br />
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • I have installed itunes 11.0.2.26. When I delete a file or podcast I am not being prompted to delete the file from its folder at the same time.

    I have installed itunes 11.0.2.26. When I delete a file or podcast I am not being prompted to delete the file from its folder at the same time. How do I restore this facility? I am running a 64bit Windows 7 OS

    Is the media files in question in the iTunes library or elsewhere on the computer?

  • Had to start Firefox in safe mode cause it kept crashing after i deleted the file. Now Fire fox Crashes every time I open it and I have to put it in safe mode j

    Had to start Firefox in safe mode cause it kept crashing after i deleted the file. Now Fire fox Crashes every time I open it and I have to put it in safe mode just to use it, also it's not syncing with my iPad.

    If you use Norton software, try disabling your Norton extensions. As of last week, there were severe compatibility issues with Firefox 24.

Maybe you are looking for

  • How the storage unit get populated automatically in TO during GR?

    Hi, I have a question to ask you with regards to SU in WM. I perform a goods receipt against a production order in MIGO. and I notice the Transfer Requirement get created and the Transfer Order also get created automatically in the background. My que

  • How to handle tree view control in business one ui sdk

    Hi, Can any guide me on how to handle tree view control in business one ui sdk? Thanking in advance. With Regards, Ram.

  • Authorization Scheme vs. "Authorization Scheme"

    Hi, I've just completed building four Authorization Schemes for my app; is_admin, is_pm, is_user, is_read mapping to my concept of roles for admin, pm, user and read-only. Pretty self-explanatory and I set them up across my app so they could perform

  • I don't understand how to setup iChat Server

    I have iChat server running, but when I try to setup an account on the client side, I get an error that the Jabber user ID is invalid. I don't understand. Why wouldn't the Jabber ID not be the same as the login information for the rest of the service

  • 2 Copies of Movie?

    I just created one of my first short films and want to post it onto my Web Gallery on .Mac. The way I understand it, the only way to do this (aside from pulling the movie into iPhoto and publishing) is to go through iMovie. So, even though the movie