Which method can delete/remove a file ?

before i write data to a file, i want to empty/remove the file ?
so which method can remove a file?
thanks.

If you are using a RandomAccessFile you can truncate it.
RandomAccessFile#setLength() or you can can File#delete()

Similar Messages

  • HT1391 How does one delete apps or files from iCloud Permanently so I may re-download without retrieving existing cloud file?for example the U2 Marketing fast , an Album I have no interest in...is now in my Cloud.. How can I remove this File from iPhone &

    How does one delete apps or files from iCloud Permanently so I may re-download without retrieving existing cloud file?for example the U2 Marketing fast , an Album I have no interest in...is now in my Cloud.. How can I remove this File from iPhone & cloud

    Hey there Matt.dvs1,
    Although there is not a way to remove past purchases from your iTunes account completely, you can hide them so that you don't have to see them if you don't want to. This article will help you do that:
    iTunes Store: Hiding and unhiding purchases - Apple Support
    Hide your purchases
    Open iTunes on your Mac or PC.
    From the Store menu, choose Store > Sign In, and then enter your Apple ID and password.
    Go to the iTunes Store.
    Click Purchased from the Quick Links section on the right side of the iTunes Store.
    Choose a content type by clicking Music, Movies, TV Shows, Apps, or Books from the top of the window.
    A list of your purchased items for the content type you are viewing will appear. Mouse over the item you want to hide until an X appears its top-left corner.
    A confirmation dialog will appear once you click the X.
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • I have an application in my Firefox Options which I can't remove any help would be great

    I have a download torrent called Bitlord which I have removed through my control panel - but it appears it is still there in my Options Applications which I can't removed - any help would be great

    Hello liz1411, check also if you have something related to Bitlord (like toolbars) in Firefox Extensions and delete it, go from Firefox button(the orange button at the right top) > Add-ons > Extensions.
    thank you

  • How can I remove a file on server w/ my JSP app running on Tomcat 7 ?

    First of all, I'm posting here because I found it the closest to java web development in the forums listing.
    How can I remove a file on the server side with my JSP app running on Tomcat 7 ? I did it in a JSE app by changing permissions, but how can I do it for a simple JSP app ?
    My code is
    public static void excluirArquivos(String nomeArquivoExcluido) {
              File arquivoExcluido = new File (nomeArquivoExcluido);
              arquivoExcluido.setWritable(true, true);
              SecurityManager sm = new SecurityManager();
              try {
                   sm.checkDelete(arquivoExcluido.getAbsolutePath());
                   System.gc();
                   if (arquivoExcluido.delete()) System.out.println("File '" + nomeArquivoExcluido + "' successfully removed.");
                   else System.out.println("File '" + nomeArquivoExcluido + "' wasn't removed somehow.");
              } catch (SecurityException se) {
                   System.out.println("File '" + nomeArquivoExcluido + "' can't be excluded. There is no permissions.");
         }And it always falls on the catch statement.

    899238 wrote:
    How can I remove a file on the server side with my JSP app running on Tomcat 7 ? I did it in a JSE app by changing permissions, but how can I do it for a simple JSP app ?1. make sure that the JVM has the (filesystem) rights to be able to remove said file
    2. make sure the file is in fact not locked (for example, opened by another process)
    3. use File.delete()
    There is no guarantee that you can delete a file, you can only make an attempt. There can be any number of reasons, most if not all of them not related to code, that the deletion of a file does not work.

  • How can i remove secure files from the trash? I tried click away the secure notification in info, but still i cann't remove them. Is there a buttoncombination to use?

    How can i remove secure files from the trash? I tried click away the secure notification in info, but still i cann't remove them. Is there a buttoncombination to use?

    If you are unable to empty the trash, try holding the Option key while selecting Empty Trash.
    Otherwise, some steps in the following link may help you.
    http://support.apple.com/kb/ht1526

  • How to configure security so users can delete their own file(s)?

    I have configured our file server so that all users can write/modify in any other user's folder. However, it seems that they cannot delete their own file(s) in another user's folder. Do I have to give all users the "Modify" but not Full permission
    so that every user can delete their own file or folder even if it's in another user's folder? I still do not want user A to delete/modify any files/folders that user B originally created.
    Any help is much appreciated.

    Hi,
    Based on my research, if a user can rename a file/folder, then he/she can save it using the original name, there is no way to prevent this via permission assignment.
    You may need to use scripts to achieve this.
    Best Regards,
    Amy Wang

  • My I-Pod Touch contains an audible book, which I can not remove.  It does not appear in I-Tunes, and this takes up so much memory that I can't sync my i-Pod.

    My I-Pod Touch contains an audible book, which I can not remove.  It does not appear in I-Tunes when I try to sync, and this audio book takes up so much memory that I can't sync my i-Pod.
    How can I remove this from my i-pod?
    Thanks

    Did you already make sure that Apple Mobile Device Service is installed and active on your computer?
    http://support.apple.com/kb/TS1567
    More troubleshooting about your device not recognized in Windows can be found here: http://support.apple.com/kb/TS1495

  • Can I remove backuped files/folders from Azure Backup storage without un-registor the servers ?

    Can I remove backuped files/folders from Azure Backup storage without un-registor the servers ?
    I want to remove some backuped files/folders to compact Azure Backup Storage and to save the cost of Azure Backup.
    Scenario 1: remove tempolary files from Azure Backup Storage.
    Scenario 2: remove no-recovery files from Azure Backup Storage.
    Scenario 3: move the files from backup target folder to other storage's folder.
    Now, To remove backup files/folder from Azure Backup storage, I seems to need un-register the servers, and register the server.
    Regards,
    Yoshihiro Kawabata

    Thank you Giri, for quick reply.
    I want to save the Azure Backup storage cost, now.
    I don't want to pay the Azure Backup storage cost for no-restore-need files until the backup point gets aged.
    and I don't want to remove / re-backup the restore need files by un-register/register operation.
    I feedback this issue to feedback.azure.com.
    "Remove files/folders from Backup"
    http://feedback.azure.com/forums/258995-azure-backup-and-scdpm/suggestions/7421659-remove-files-folders-from-backup
    Regards,
    Yoshihiro Kawabata

  • How can I remove .nrw files from my NOKIA Asha 200...

    When I am connecting my NOKIA Asha 200 with my PC by data cable, I am watching almost 50 nos. *.nrw files inside the Image folder. I tried to delete all those file, but I was unable. Is there any one, who can tell me how to remove those files from my phone memory?
    Thanks & regards,
    Sudip Sinha.
    Calcutta.
    India.

    Back-up your data and then Factory Reset your phone ...(Menu-->Settings-->Restore Factory settings-->Settings only.. followed by 12345 which is default security code, unless set by you) .. When the phone reboots, check whether these .nrw files are now converted to .jpg .. If so, you should be able to delete them now ...

  • Error #3003 : can't remove a file into ApplicationStorageDirectory

    I have coded a process on image file wich is working with adl (FlashBuilder debugger) but it never works in emulator (an Android release APK), although I adapted it correctly, I think, from an AIR plateform version. The good thing is that I can pick an image to application into the two plateforms !
    Bad thing is I can't delete the file in applicationStorageDirectory on Android version.
    Two questions : In first, I'm not sure to have writing and removing file permission, I seems to be ok ?
    Secondly, did I use the right method to delete a file located into applicationStorageDirectory ?
    I can be In first I get the physical image to fileSystem with method :
    myImgFile.browseForOpen("title", [imagesFilter])
    on adl. Secondary I got physical image with all the specific events of CameraRoll class, and the
    myCameraRoll.browseForImage()
    interactive method on my Android packaging for testing version.
    protected function onAjouterFichierPhoto(event:CollectionEvent=null):void{
        var myImg:Image = new Image();
        myImg.source = event.currentTarget[0].nom; // Utilisation de acResultatFichierImg.nom
        var strImgSource:String = myImg.source.toString().substr(13);
        try{
            var myFile:File = File.applicationStorageDirectory.resolvePath(strImgSource1.substr(13));
            myFile.deleteFile();
            if(myFile.exists == false)
                trace("Fichier supprimé du storageDirectory !");
        catch(e:Error){
            trace("Photos->viewAjouterImage->Erreur #"+e.errorID+" : "+e.message+"\n");
    I received error #3003 "File or directory does not exist", does anybody know the reason of this wrong return ?
    NB : To be more precise, If I see the return of the variable strImgSource, I can see that : "storage:[photoName]" !

    I'm sure that the file exists, but I don't understand the response !

  • Which method can replace parseQueryString()

    Hi,
    javax.servlet.http.HttpUtils.parseQueryString(java.lang.String s) which is used to parse a query string passed from the client to the server and builds a HashTable object with key-value pairs has already been deprecated. I got the warning when I compiled the code. What's the method can replace parseQueryString() which can provide me the same functionality ?
    many thanks.

    From the API Docs for HttpUtils
    Class HttpUtils
    java.lang.Object
    |
    +-javax.servlet.http.HttpUtils
    Deprecated. As of Java(tm) Servlet API 2.3. These methods were only useful with the default encoding and have been moved to the request interfaces.
    This means that you will need to use the HttpServletRequest interface methods.

  • Open File dialog user can delete and rename files.

    Does any one know if there is a way to prevent a user from deleting and renaming files by right clicking on them in an Open File dialog box?

    Well, the problem is that this isn't a LV dialog box. It's the standard Windows file dialog box and this is the way they work in Windows.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Which method can get the computer  screen photograph

    besides the createscreencapture method of robot class,which method have the
    function of grabing computer screen photograph.thank you.

    Do you know and this is some sort of competition to name the other method and class? Or do you not know - in which case: why don't you want to use createScreenCapture()?
    [Edit] I don't think there is a way that doesn't involve the Robot class.

  • How can I remove a file that is no longer associated with a page?

    I have a hurdle that is preventing me from completing a task.
    I am trying to build a spry asset--specifically a vertical menu. When I initially built the page, I built the menu. However, the look was rejected and I was asked to re-create it. I went back, removed all references to the spry asset, and stripped the menu from the page. But when I open the page which I want to build the menu on again, it is still showing that a .css and .js file are associated, event though they aren't. And when I try to rebuild the asset, it won't  add the proper .css and .js file because it thinks the files are already created.See the screenshot below to view what I'm talking about.
    If anyone has an idea of how to tell Dreamweaver that those two files are no longer associated with the page, I would appreciate some help. THis is the last major hurdle before I can complete a project.
    Thanks,
    Ken

    Hi
    Providing you have removed all references to the js/css files, (have you removed the code at the bottom of the page?), use the spry updater to insert your new js/css.
    You can get the spry updater extension form the downloads box here - http://labs.adobe.com/technologies/spry/.
    PZ

  • Can't remove user files from trash

    I tried to remove user.
    The operation crashed.
    I later deleted the user directories while signed on as another user.
    Now the original user files are stuck in the trash and I can't delete them.
    Can't even reset permissions.
    What should I do to rmeove them?
    Thanks
    karl

    karlfromdurham city wrote:
    I tried to remove user.
    The operation crashed.
    I later deleted the user directories while signed on as another user.
    Now the original user files are stuck in the trash and I can't delete them.
    You don't delete a User account by dragging the User's folder to the trash.
    Open System Preferences > Accounts (or Users and Groups I believe it is in Lion).
    You cannot be logged in to the account you're deleting, and you must be logged in to an Admin account.
    Click the padlock to unlock the pane, select the User in the list of accounts and click the - (minus) sign below the pane.
    You'll be asked what to do with the users home folder - simply select delete and click OK.
    No need to get yourself in a permissions pickle.

Maybe you are looking for

  • How can i transfer music from my computer to my ipod?

    how can i transfer music from my computer to my ipod?

  • Enabling VNC or Fire Wire booting

    Hello Mac People, Is there anyway to access "System Preferences" remotely? I need to check and make sure that "Remote Management" is enabled on a FULL XSERVE server running 10.4.11. I will be using a Mini-Mac also running 10.4.11; this is only going

  • Applying RUP6 patch

    I am applying the patch RUP6 patch 6728000. I assigned 8 workers. Looks like it is hanging for the past 9 hours. The following is the last part of the adpatch log: There are now 9045 jobs remaining (current phase=A1): *0 running, 24 ready to run and

  • 32 bit emulation? What's that?

    You might have seen this post of mine: http://bbs.archlinux.org/viewtopic.php?id=33876 Wandering around seeking the solution I found this message: http://www.linuxgames.com/forums/index. - ed8214fdef 32 bit emulation? What's that? Can be obtained usi

  • Details tab of monitor tab

    hello all, When I go to the details tab of the monitor tab to do a simulation and update rule debugging, i get a timed-out error. It is taking a very long time. Any suggestions.corrections , please. Meps