File rename Issue

I am trying to parse xml file and generate output file by Jaxp this one works fine.
In process i am creating new temp output file .
Now i want to rename this outfile as original file .
     File xmlFile = new File("E:\\sample.xml");
        File OutFile = new File("E:\\sample_new.tmx");
           Process on XML  and write to new  file ; // this works fine
       if (xmlFile.exists()) {
                  xmlFile.delete();
                OutFile.renameTo(xmlFile);// here it is failing to rename.
    }Please suggest solution on this
Edited by: AmitChalwade123456 on Dec 2, 2008 6:48 AM

javaException wrote:
Copy the absolute file path like this:
String filePath = xmlFile.getAbsolutePath();
xmlFile.delete();
xmlFile = new File(filePath);
i tried that earlier but did not work

Similar Messages

  • LR3 - Import file renaming issue

    I'm having an issue with renaming files when importing.
    I import using YYYYMMDD at the begining of the file name. However any photo that is taken after around 2pm on a given day gets tomorrows date.
    Any ideas?

    Known bug.
    http://forums.adobe.com/message/2880448?tstart=0#2880448
    The workaround at the moment is to not rename on import, but in Library after import. Strangely, renaming in Library works correct.

  • Weird file renaming permission issues

    Hi!
    We have a file rename permission issue. Here is the background:
    We created a 2008 R2 DFS namespace called UserData with Read/write share permissions for Administrators, Everyone and System. UserData has been granted NTFS permissions as follows:
    Everyone (This folder only): Traverse folder / Execute files, List folder / Read data, Read attributes, Create folders / Append data
    CREATOR OWNER (Subfolders and files only): Full control
    SYSTEM (This folder, subfolders and files): Full control
    Domain Admins (This folder, subfolders and files)
    We then enabled folder redirection for users My documents folder through GPO, setting the following:
    Setting: Basic - Redirect everyones folder to the same location
    Target folder: Create a folder for each user under the root path
    \\domain\UserData
    We also unchecked Grant the user exlusive rights to documents.
    So, now to the really weird behaviour. We logged on to a Windows 7 (x64) client computer with a user who gets this GPO settings and that is not local administrator on the client. The folder is redirected as expected and we can create, delete and write to
    files in anyway we want. We can also rename files if we choose an entirely different name and if we choose a longer or a shorter file name,
    but we cannot rename the file to something with the same letters but different casing.
    Examples of what will work:
    "test" to "testing"
    "test" to "cool"
    "test" to "COOL"
    Examples of what will NOT work:
    "test" to "Test"
    "test" to "tesT"
    "test" to "TEST"
    We the get this error: "File Access Denied. You need permission to perform this action. You require permission from S-1-5-21-220..... to make changes to this file."
    Eventhough I'm pretty sure the share and NTFS permissions of the share are correctly set we have of course checked all the permissions when logged in and the user has Full NTFS control and Read/Write Share permissions.
    We have encountered the same problem on a customer company as well, with a different domain with no links to our domain what so ever. I have also seen similar problems from other people when trying to find the answer on internet. Here is an example:
    http://social.technet.microsoft.com/Forums/en/w7itprosecurity/thread/35ced5bb-ab13-4e28-8c48-7c68ce0b775c
    Anyone have any thoughts?
    /Leyan

    Resent discoveries:
    If I log onto a Windows 7 (x86) Enterprise I face the same Issues.
    If the same user logs on to one of the DFS servers holding the namespace and accesses his folder we experience
    no problems renaming files.
    Customer company states that all is working fine when user logs on to a Windows XP with SP3.
    /Leyan

  • Custom File Renaming Template Keeps Changing

    I'm having issues when creating a custom file naming template in Tiger with LR 1.3.1.
    When importing files, I created a custom template to rename the files with YYMMDD_{original file suffix}{Master}.tif to get this: 071217_12056Master.tif. The first import goes fine. But when I import another batch of files and choose the template all I get is 071217_Master.tif.
    I tried creating the template by hitting F2 to rename the photo and get the same results. The really odd thing is that some of the other templates have their characteristics jumbled around so that what I thought was the "orig file-name" template might actually produce something like 071217_.tif.
    The original file suffix suffers the worst in terms of disappearing without cause. This behavior was occurring in the 1.2 ver. as well. I've deleted every single template thru the editor, recreated them again and still get the errors.
    Hopefully someone here can provide some clues?
    Thank you!

    It sounds as though your import preset either isn't working or wasn't setup correctly.
    Using the full screen import panel, make sure Copy or Move is selected and then select your Import Preset....what does the File Renaming panel look like? "Rename Files" should be ticked, Template should read "Custom Settings" (or the specific rename preset if you've saved it) and the sample should show the correct rename format, like so:
    So does yours look like this, or different?

  • File rename doesn't add leading zeros to renaming files sequence? And a pat on the back to the LR de

    First of all, LR truly rocks. Any Adobe folk reading this, please take this note as a massive pat on the back for your team. There's a lot of childish and naive negativity from people posting in this forum. And I suspect from folk who are not really your key market for this app. I feed my kids by running a photography business and have been shooting digital since the early 90s...ya know...
    LR will be looked at as a massive sea change in the development of digital photography. The first time the entire workflow process is truly viable from end to end. What will make LR the ultimate winner in it's field is simply the integration with Photoshop. Aperture, Capture One etc cannot ever beat LR regarding this and so, just like the way that Excel and Word and Powerpoint all work together and everyone uses them, LR will inevitably become the de facto standard way of managing RAW images for pro photographers.
    Even with the few bugs (specifically file movingon Mac OS10.4.9) LR has shaved HOURS off our workflow. We shoot around 250 gigs of images a month in our weddings and event business. Now all of our editors use LR. No more Capture One etc for us.
    Here's the question - There seems to be no way to add leading zeros to a file rename command. So if you rename a batch of images they appear as 1,2,3,4,5,6,7,8,9,10,11,12 etc so now when I look at them in Bridge or other apps, they are now sorted 1,10,11, etc
    Now let me tell ya this is a pain.
    Any comments or comfort that is is a known issue would be appreciated. All we want is a way to have the rename add the leading zeros like most other apps do...
    Best to all
    William Henshall
    www.californiaweddingphotos.com
    PS By the way, I am a HARD *** about shoddy unstable software sold to pro photographers as the "prefect solution" that doesnt work as advertised...I am that guy that the tech support guys at certain companies dread. Yep, I simply expect an app to do what it says, just like the car I buy. I once resorted to sending the CEO of a certain software company an invoice for my time restarting, reinstalling the OS and bug finding another similar app. You can image, I got a personal call...heh...

    William-
    <br />
    <br />I just changed a folder of 85 images' names, and typed in 001 as my starting number. While no zeroes were prepended, the pix show up in order both in the Finder and in Bridge CS3.
    <br />
    <br />Say a bit more about file moving on your Macs.....
    <br />
    <br />
    <span style="color: rgb(102, 0, 204);">John "McPhotoman"</span>
    <font br="" /></font> color="#800000" size="2"&gt;~~ John McWilliams
    <br />
    <br />
    <br />
    <br />MacBookPro 2 Ghz Intel Core Duo, G-5 Dual 1.8;
    <br />Canon DSLRs

  • LR 5.7.1 File Renaming start number field is missing

    Installed Lr CC 5.7.1 on a MacBook Air OS 10.10.2 - in the Lr import window in the File Renaming panel the Start Number field is missing and I can not add a start number to the files?  Any suggestions on what is causing this issue and how to repair this Start Number field omission?

    Sounds like you are looking for the "sequence" field. The "original file number" is also a good one to use.

  • Files renaming themselves

    I have had on ongoing problem with files renaming themselves most often with a numeric file name. It has happened with Quark , Illustrator and Photoshop files. There is no pattern... it happens randomly at different times. File names are less than 31 characters. Sometimes when I have linked files in Quark from Photoshop, the linked names willl change but not neccessarily the file name itself on the hard drive. Sometimes both names change, sometimes only the linked name will change in the usage box in Quark, sometimes the file will rename itself on the hard drive. For instance, a file recently named SPI6007_past_presentadult.qxd has renamed itself on my hard drive as QXP-1055969291.qxp In this case, it has created another file and did not replace the original. This has been an ongoing issue and I have worked at several agencies with several different computers and several different Mac Operating Systems. Any help is much appreciated. Out IT guys are stumped.

    Gary,
    I have had this problem over our network. I transfered a folder with a Quark file and about 50 pieces of art. Most of the art had changed to numbers. I would have been sunk if it were not for the folder still on the server. Still had a lot of changing to do. Other computers on network have not been affected--yet. I have had problems with Quark, Photoshop and Illustrator files changing from app files to Unix files. I have searched the discussion pages and have not found a beneficial solution. One thing I have done is to install Quark, Photoshop and Illustrator on our server. This forces the system to recognize the icons and . I am telling our artists to let the program add the extension and for them not to delete it. This will solve the problem from this point on. We still have lots of art that do not have extensions and will cause problems. One site that was somewhat helpful that I would recommend is www.thexlab.com. You will find some information there about resetting launch services. Good luck.

  • File renaming and second copy

    If I import RAW and tick 'Copy as DNG' and 'Make a second Copy' and 'File rename: Prefix-Date-Image#', the 'second' copies are not DNG and not renamed.
    If I import JPEG and tick 'Copy' and 'Make a second Copy' and 'File rename: Prefix-Date-Image#', the 'second' copies are renamed!
    So why in case of RAWs are the second copies not renamed? This bug precludes the use of more than one camera at a shoot.
    LR3.6
    How come??? I recall this was an old issue; is it too difficult to repair such a simple bug???

    If this is changed, make sure it is a choice as otherwise the copy function is of no use to me. I do not want LR to make changes to the original files that I copy for backup in any way. I use the function for how it was designed (a temporary back up with no changes made to the files from the card) and make back ups of the files in the LR catalog separately. Once everything is safely backed up I can then delete the temporary copies.
    I would guess there are lots of others like me who don't want this situation changed as we have been doing this for several years now since prior to LR 1 when the thing was in beta..

  • File renaming with drag & drop import

    I want to import images on disk by dragging to projects to avoid the painfully slow import dialog animation, but I also want to rename masters on import. Is there a way to do this?

    Ah
    I think it is actually an Apple App switcher thing.
    So if the finder window does noy cover the After Effects Project window, it works, but if you have to use the app switcher, sometimes it works and sometimes it doesn't.
    I don't think it is a file type issue, so much as a live application issue, or maybe GPU related.
    It's a weird thing, not that important, but it does limit where you can and can't drag from.
    Tris

  • Creation date used during ingest File Rename incorrect

    Hi
    System:
    Windows 7 64-bit SP1
    Prelude CC v2.0.1 (118)
    I've been using Prelude about 9 months now and have got used to it's foibles.  Hopefully some of these are being addressed for future releases.
    But the recent update seems to have introduced some problems that I didn't notice in previous versions.
    My query is on the new File Rename feature (the lower part of the Ingest panel).
    I have a preset for renaming my clips.  I want to rename using:
    Custom Text - I type this in depending on which location
    Date - I select DDMMYY Creation Date
    Auto Increment - (01)
    I have two issues using this preset, it could be me idk.
    The first is that the Creation Date appears as today's date, not the one from the file as I would understand it.  I would prefer it to pick up the actual Creation Date as it shows in the Metadata of the clip and also the time (i know this has already been suggested by an FCP user).
    The second is that If i rename a batch of files using the Auto Increment and then decide I want to add some more footage shot at a later date but maybe the same location.   I already have for example files labelled location_01 to location_15.  Now i want to ingest some more but starting at location_16.  Currently, I can't change the AutoIncrement field setting as you can in Bridge CC. 
    How I wish u could just implement the Batch rename features of Bridge in Prelude.  I am trying to switch from Bridge as it doesn't play nicely with video on my system.  It's a pain.  I love Prelude but can u please improve the renaming function.
    If the creation date was correct the auto increment feature would not be an issue because the files would be named differently.  As it is, ingesting tons of footage on the same day results in chaos.  Having to remember to manually change the date (I have it as a Custom Text field) is a nightmare and I can see forgetting to do it then it will be a mess.
    Perhaps my workflow is slightly different to someone who works in say TV but it would be nice when I know the features present in Bridge applied to all the other Suite apps.
    Any pointers would be REALLY useful because this is driving me insane at the moment.  And you guys are understandably reluctant to release details of future changes and features, so who knows you could be working on it right now.
    Thanks
    Just found there is another post asking more or less the same but no comments
    http://forums.adobe.com/message/5823964#5823964
    Message was edited by: GraphiteGal

    I'd like to second the request to be able to change the starting value of the auto increment function when ingesting in Prelude CC. 
    If I'm ingesting batches of footage either from different cards or at different times, it creates a mess of both manual file renaming in Finder (or batch renaming—same issue of additional, unnecessary work) and also (sometimes?) getting "file ingest error" messages from Prelude because I've already imported a file with the Custom_Text_(01) name.
    For anyone else with the same issue: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    Thanks!

  • Files Renamed when importing to LR4 and now can't find them in LR3

    Help!  What should I do???
    Yesterday I installed LR 4 Beta.  I had a folder with 300 images in it on LR 3, obviously all files had names.  I imported these photos into LR4 to work with LR4 and they were renamed in the process.  Now in my LR3 folder, all the files still have there old names and the "missing photo ?" and I assume that's because the name has been changed and LR3 can't find them.  Any thoughts on an easy fix?
    Thanks,
    Matthew Kraus

    Thanks so much for helping me with this.
    I must admit, I didn't pay too much attention when importing this "test"
    group of photos to LR4, therein lies my problem.  Now that I look at the
    import settings that were used:
    1. Files were not added or copied, they were "moved" to a new location and
    also renamed.
    2. Files were renamed starting with "264" using my regular import template.
    Listed below are the first 10 photos with their original LR3 and he
    changed LR4 names.
    1201_001 changed to 1201_264-2
    1201_002 changed to 1201_265-2
    1201_003 changed to 1201_266-2
    1201_004 changed to 1201_267-2
    1201_005-Edit-Edit changed to 1201_268-2
    1201_005-Edit changed to 1201_269-2
    1201_005-Edit changed to 1201_270-2
    1201_005-Edit-Edit-2 changed to 1201_271-2
    I have a back up of my images on an EHD from several days ago which has the
    original file names, but this backup only has 203 of the 268 images I
    imported yesterday and are renamed.
    Thanks again,
    Matthew Kraus
    2012/1/11 Dorin Nicolaescu-Musteață <[email protected]>
       Re: Files Renamed when importing to LR4 and now can't find them in LR3 created by Dorin
    Nicolaescu-Musteață <http://forums.adobe.com/people/dorin_nicolaescu> in *Photoshop
    Lightroom* - View the full discussion<http://forums.adobe.com/message/4132062#4132062>

  • Restoring from backup to new location + not wanting files renamed

    Hi there - I am a newbie to this forum.
    I have a Win XP machine that recently needed to have the hard drive wiped and the OS re-installed. Fortunately I had a recent backup of all my data so I'm in a good starting position for a restore. However I have some questions as the re-install of the OS has had a change in profile name.
    Before my machine was wiped, I had a "Daniel" profile and so my "iTunes Media folder location" was set to C:\Documents and Settings\Daniel\My Documents\My Music.
    After my PC was rebuilt, a new profile was created called "dnl". iTunes has been re-installed (version 10.1.2.17). The first time I launched iTunes the "iTunes Media folder location" was set to C:\Documents and Settings\dnl\My Documents\My Music. I did NOT choose to have iTunes browse/load my files and so currently iTunes shows no files or playlists.
    I have recreated the C:\Documents and Settings\Daniel\My Documents\My Music folder from my backup so all the music files and the previous libraries are presently in this location. However even if I change the "iTunes Media folder location" within iTunes to point to the "old" location, it doesn’t find the files or libraries.
    I have tried deleting the following files from C:\Documents and Settings\dnl\My Documents\My Music\iTunes:
    iTunes Library Extras.itdb
    iTunes Library Genius.itdb
    iTunes Library.itl
    iTunes Music Library.xml
    I did this assuming that the next time iTunes was launched, it would refer to the old location (as specified as my "iTunes Media folder location"), find the old library files there and use them. However it seems to ignore them and simply re-creates the files above in the location I deleted them from.
    So…I am unclear as to the best strategy to have iTunes point back to the old location to find the music files and retain all the playlists I had.
    I found this thread: http://support.apple.com/kb/ht1364. It mentions a method that will find all the files in the old location and move them to the new location, retaining playlists, artwork etc. Once the data has been copied, it advises to delete the files from the original location.
    However I see that it mentions checking the ‘Keep iTunes Media folder organized’ option. From reading other threads I know this to be a source of one very irritating problem – it renames all the file names. I have specifically ripped my music using software other than iTunes for the express purpose of being able to tag the filenames with more specific info than iTunes would. I like the files to named <artist>-<album>-<track no>-<track title>.<file extension> and am not a fan of the very basic filenames that iTunes assigns.
    So…I want to have iTunes simply point back to the old location and not do any file renaming. I am happy enough to have iTunes simply point to a location that isn’t technically part of my current profile. I don’t have a desperate need for the files to be moved to the dnl profile.
    So…I am guessing there has to be some other file (or registry setting?) that knows where best to point to? Can this modified?
    I would be appreciative of any assistance.
    Thanks!

    Hi Daniel, welcome to Apple Discussions.
    The default location for the iTunes library folder is <Profile><Music>iTunes with the media folder at *<Profile>\<Music>\iTunes\iTunes Media*. For XP the <Music> folder is My Documents\My Music.
    When iTunes starts up it looks for a set of library files in the last location it used. If that location is also the default location and it can't find the library files it assumes it has just been installed and creates a new set.
    Changing the location of the *iTunes Media* folder in preferences does not change which set of library files it opens, nor will it automatically detect all the media in that location.
    Ideally you should restore the folder iTunes and all its subfolders from your backup into *C:\Documents and Settings\dnl\My Documents\My Music* and start iTunes. All should work perfectly and, as far as iTunes is concerned, you will be using the same library as you used to. Any iDevices should sync without problems.
    If you media was not is the usual locations or you are unable to restore the entire iTunes folder then things become more complicated. Post back if you still have trouble and I will try to go into more detail.
    tt2

  • Bridge Photo Downloader File Rename convention

    I use a custom file rename preset (YYMMDD + TEXT + FILE NUMBER SUFIX) in BR CC. This custom preset is not available in the Adobe Bridge CC Photo Downloader Reneame Files drop down menu. Neither is the custom preset formula availble in the advanced rename dialog.
    I end up importing files with the Bridge Photo Downloader (Do not rename files) and then rename files using the Bridge Batch Rename saved preset.
    Is there a way to add a custom file rename convention which is not availble in the Bridge Photo Downloader?
    The idea is to rename files during the file ingestion process.

    Omke
    Thanks for the idea. I tried that but it didn't work. The exact same problem happened again with what appears to be the same crash log: Thread 18 Crashing (see below for that specific section)
    Additionally now in the last week I am experiencing Bridge crashing 1-3x/day regardless of the Photo Downloader.
    Adobe, please advise.
    Thanks
    LW
    Thread 18 crashed with X86 Thread State (32-bit):
       eax: 0x00000000  ebx: 0x903bd3e4  ecx: 0x00000001  edx: 0x00000011
       edi: 0x00000080  esi: 0x00000000  ebp: 0xb0a07858  esp: 0xb0a07810
        ss: 0x0000001f  efl: 0x00010287  eip: 0x903bd433   cs: 0x00000017
        ds: 0x0000001f   es: 0x0000001f   fs: 0x0000001f   gs: 0x00000037
       cr2: 0x00000000

  • PS CS3, Camera Raw 4.6 Update and Nikon D810 NEF File Reading Issue

      Currently Have Photoshop CS3 & Adobe Bridge CS3 2.1.1.9.
    According to Adobe, Camera Raw 4.6 supports Nikon D810 NEF files.  I have downloaded Camera Raw 4.6 Update. When
    I try to open Nikon D810 NEF files, I get Photoshop CS3  error that says
    "cannot complete request your because it is not the right kind of
    document. These NEF files wont open in Adobe Bridge at all.  What am I doing wrong?

    Hey,
    Before I purchased, let me get your thoughts on another option that just occurred to me which involves:
    1)Editing my D810 NEF files in LR 5.6, which I have, then exporting/saving the edited files as JPEGs.
    2) Doing any additional editing, as necessary (i.e. that might require layering or selections..etc) , with the JPEGs  with Bridge or PS CS3. 
    This method wont involve any additional software purchase now.. right?    Am I missing anything.   here?    Since my final output to my customers are JPEGs any way, wont this work?   Will I be at any disadvantage.   Am I missing anything.   here? 
    From: ssprengel <[email protected]>
    To: charles cash <[email protected]>
    Sent: Monday, October 6, 2014 9:49 AM
    Subject:  PS CS3, Camera Raw 4.6 Update and Nikon D810 NEF File Reading Issue
    PS CS3, Camera Raw 4.6 Update and Nikon D810 NEF File Reading Issue  created by ssprengel in Adobe Camera Raw - View the full discussion  
    You can buy it from here:
    http://creative.adobe.com/plans
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6795004#6795004
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: 
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link. 
    Start a new discussion in Adobe Camera Raw by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Use plug-in metadata for file renaming?

    Hi there,
    I'm writing a plug-in that adds a new export method to Lightroom and that defines some plug-in metadata fields.  I'd like the users to use these metadata fields to define their file renaming pattern in the export dialog. That means I'd like to create a token pattern from a plug-in metadata field.
    Is there a way to accomplish this?
    Regards,
    Robin

    I don't believe there's any way to incorporate plugin metadata fields directly into the builtin renaming patterns.   A couple of possibilities for alternate solutions:
    - Appropriate an existing metadata field that the renaming patterns know about (e.g. Description Writer) and have your plugin set that field with the desired custom metadata using photo:setRawMetadata(). 
    - Use or adapt the Exportant plugin, which provides greatly expanded file renaming possibilities.  The author Role Cole contributes here and is very helpful.

Maybe you are looking for