Renaming the files present inside a war file.

Hi,
I am using the java.util.zip API for reading a war file(a zip file).
I wanted to know whether its possible to rename a particular file present in the zip using this API.
Thanks in advance.

You can't edit a ZIP file with the standard libraries.

Similar Messages

  • Renaming the file

    Hi
    Good Morning friends
    Can anyone help me in this
    I want to select one file from presentation server and rename that file and to be saved in same location.Is there any program,
    guide me friends
    Regards
    Kiran

    Hi Kiran,
    There is a way to rename a file using FM 'GUI_RUN'.
    Create a batch file in the Presentation server and call it by FM 'GUI_RUN'.
    I have developed a small report which will achieve it.
    Just try below code.
    REPORT  zpr_test1.
    TYPES: BEGIN OF ty_itab,
          text(100) TYPE c,
          END OF ty_itab.
    DATA: filetable TYPE filetable,
          rc TYPE i,
          wa_file TYPE file_table,
          ret TYPE i.
    DATA: itab TYPE STANDARD TABLE OF ty_itab,
          wa TYPE ty_itab,
          len TYPE i,
          len1 TYPE i,
          str1 TYPE string,
          str2 TYPE string,
          old_name TYPE string,
          new_name TYPE string,
          filename TYPE string,
          cmd(200) TYPE c.
    DATA: tab_pop  TYPE TABLE OF sval.
    DATA: wa_pop  TYPE sval.
    *Get file name
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      CHANGING
        file_table = filetable
        rc         = rc.
    READ TABLE filetable INTO wa_file INDEX 1.
    IF sy-subrc = 0.
      wa_pop-tabname   = 'FILE_TABLE'.
      wa_pop-fieldname = 'FILENAME'.
      APPEND wa_pop TO tab_pop.
    *Get new file name in popup
      CALL FUNCTION 'POPUP_GET_VALUES'
        EXPORTING
          popup_title     = 'Enter new file name without extension:'
        TABLES
          fields          = tab_pop
        EXCEPTIONS
          error_in_fields = 1
          OTHERS          = 2.
    ENDIF.
    *Build new file name
    READ TABLE tab_pop INTO wa_pop INDEX 1.
    IF wa_pop-value IS NOT INITIAL.
      new_name = wa_pop-value.
    ELSE.
      new_name = 'New'.
    ENDIF.
    *Build batch file
    ***Build drive name
    wa-text = wa_file+0(2).
    APPEND wa TO itab.
    CLEAR wa.
    ***Build path
    len = STRLEN( wa_file ).
    len1 = len - 1.
    DO len TIMES.
      IF wa_file+len1(1) = '\'.
        wa-text = wa_file+0(len1).
        EXIT.
      ENDIF.
      len1 = len1 - 1.
    ENDDO.
    CONCATENATE 'CD' wa_file+0(len1) INTO wa-text SEPARATED BY space.
    APPEND wa TO itab.
    CLEAR wa.
    ***Build old file name
    str1 = wa_file.
    WHILE str1 CA '\'.
      SPLIT str1 AT '\' INTO str1 str2.
      str1 = str2.
    ENDWHILE.
    old_name = str1.
    str1 = wa_file.
    CLEAR str2.
    ***Build extension for file
    WHILE str1 CA '.'.
      SPLIT str1 AT '.' INTO str1 str2.
      str1 = str2.
    ENDWHILE.
    IF old_name CA space.
      CONCATENATE '"' old_name '"' INTO old_name.
    ENDIF.
    IF new_name CA space.
      CONCATENATE '"' new_name '"' INTO new_name.
    ENDIF.
    CONCATENATE 'RENAME' old_name new_name INTO wa-text SEPARATED BY space.
    CONCATENATE wa-text '.' str1 INTO wa-text.
    APPEND wa TO itab.
    CLEAR wa.
    *Give name for batch file
    CONCATENATE wa_file+0(len1) '\' 'TEST1.bat' INTO filename.
    *Download batch file to Presentation server
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        filename = filename
      CHANGING
        data_tab = itab.
    cmd = filename.
    *Call the batch file to rename the file
    CALL FUNCTION 'GUI_RUN'
      EXPORTING
        command    = cmd
      IMPORTING
        returncode = ret.
    Thanks..

  • HT3775 I have a bunch of .MOD files I cannot play from our Canon video cam. I tried renaming the files as MPEG or MOV, I get the message "The document "001.MPEG" could not be opened. A required codec isn't available." Any advice on getting these to play?

    I have a slew of .MOD files I cannot play from our Canon video cam. I tried renaming the files as MPEG or MOV, I get the message "The document “001.MPEG” could not be opened. A required codec isn't available." Any advice on getting these to play? Thanks!

    Try installing Perian or VLC. Some AVIs require a codec which simply isn't available for Mac OS X.
    (85018)

  • How do I import old FCP projects that have mysteriously changed to Linux Executable files?  Is it as simple as renaming the files with the.fcp extension?

    I had some FCP projects on an old G3 tower that I finally want to finish. I was able to grab everything, media, etc. to my macbook pro but all of the Final Cut Pro actual movies/projects have turned into "linux executable files" that FCP X won't import.
    I tried googling this issue but didn't really see any good answers. Would it be as simple as renaming the files with the .fcp extension?  I can't recall if my old version (really old) of FCP saves projects as .mov or .fcp files, but I'm assuming I'm not the only person this has happened to.
    Thanks for your help!

    I had some FCP projects on an old G3 tower that I finally want to finish.
    What version of FCP was this? The project files can probably no longer be opened in the newer version of the OS. You could try adding the .fcp suffix, but I don't think it will help for this. Projects files are .fcp.
    Regardless of the version, no legacy FCP projects will import into FCPX.
    Media is a different matter. These are probably QuickTime .mov files. If these are appearing as Unix ececutables, they're probably not recoverable either.

  • Adobe photoshop CS6.Receiving the error "could not complete your request because it is not a valid photoshop document? Tried renaming the files and had working psd files and now all psd files will not open and getting the error listed. Anyone help please?

    Could not complete your request because it is not a valid photoshop document. Tried renaming the file extensions and still no luck.

    Nobody can tell you anything without proper system info or other technical details.
    Mylenium

  • Previously Firefox would show a number at the end of the file name (renaming the file by adding a number) showing that I had already downloaded a file at least once before. Recently that isn't happening. How do I get that feature back?

    When downloading, previously Firefox would show a number at the end of the file name (renaming the file by adding a number) showing that I had already downloaded a file at least once. Now that isn't happening. How do I get that feature back?

    When downloading, previously Firefox would show a number at the end of the file name (renaming the file by adding a number) showing that I had already downloaded a file at least once. Now that isn't happening. How do I get that feature back?

  • Rename the file in application server

    Hi Experts,
    I want to rename the file which is in Application Server.
    E.g:- Current File in Application Server is '\user\sd\file1'
            I want to change the above file name to '\user\sd\file1_old' in Application Server.
    Please help me if any one aware of this.
    Thanks & Regards,
    Chandu

    Hello,
    What you want to do is execute a command on the host operating system.
    This can be done with function module SXPG_COMMAND_EXECUTE.
    This module will execute commands that have been predefined in SAP. To see what is available look in SM49.
    If you have the autorizations you can create your own or ask for it to be created.
    More general information can be found [here|http://wiki.sdn.sap.com/wiki/display/ABAP/CreationofExternalCommandswiththehelpofUNIXCodingin+SAP].
    Hope this is helpful.

  • Rename the file names

    Hello OTN Help,
    I need to modify my old existing question.
    Reason is as follow:
    One of my question I entered some thing which is not appropriate for my company policy and they want from me to rename the file names.
    Please advice me what should I do?
    thanks

    Are you talking about changing the question that you have entered on OTN? If so, I guess you will need to contact Oracle support and have them to request OTN admin to do so ... good luck.
    -Frances

  • Rename the file when submitting a form

    Hi, I've to send the form in PDF format and I've got various functions to do it:
    event.target.submitForm({cURL:"mailto:[email protected];[email protected]?subject=Submitt ed Form&body=Please find attached the completed form.",cSubmitAs:"PDF",cCharset:"utf-8"});
    event.target.mailDoc(false,"", "", "", "Avaluació periode " + P1.Periode.rawValue + " de l'empleat " + P1.Empleat.rawValue , "A signar.");
    but none of those let me change the name of the file that appears as attachment.
    Could anybody help?
    Thanks in advance
    Esteve.

    Hello,
    I'm also interested in something similar. I've created a form and it has an email submit button, I would like to know how to be able to rename the file when the user clicks submit. I have a field name called UserID, I would like to pass that into the subject of the email. Is this possible? Any ideas? Any help would be greatly appreciated.
    Thanks,
    ~my

  • Is there an alternative to Canon CameraWindow to import photos and rename the files to include shooting date?

    I've used Canon's CameraWindow software for years to import large quantities of photos direct from my SD card, specifically because it renames the files based on date taken and nicely orgnizes them into folders.  I save those to an external HD and import them to my iphoto library.  Now after moving to Lion, CameraWindow isn't compatible because it's a PowerPC app I guess.  I can't find any update via Canon.  I don't really use any of the other EOS Utilities, I just want to be able to rename those files by dates, which is why I don't use iphoto to import and I've seen that suggested in other places.  I'm happy to abandon Canon software all together if there is an alternative out there.  Thanks for any suggestions! 

    Most professional photo management software can batch-rename files using metadata such as date, and can organize into date folders on import. I know that Adobe Lightroom and the Photo Downloader in Adobe Bridge can do this, and I think Apple Aperture and PhaseOne MediaPro can too. All of these programs are maintained for OS X compatibility better than Canon and Nikon software are.
    Have you looked at Canon's camera software page? They have Canon software that works with Lion and later, the only question is whether the software for your specific camera has been updated.

  • How to do search with multiple texts across documents and rename the file with found text?

    Hello:
    I'm trying to do the batch search across the multiple documents and rename the file (or save as) after the found word?
    In example:
    I have many unique texts and would want to search across the multiple documents.
    If a document is found with that unique text then, the document is either renamed or save as with that unique text. 
    So, I could know what unique text that file holds.
    How do I do that?
    Let me know.
    Thanks

    Welcome to the forum!
    When you want to post a block of code, you can enclose it with the mark ups { code }
    That is the key word code surrounded by curly brackets, but without the spaces
    You seem to be running a very old (and unsupported release of the database)
    7.3 has not been a current release for about 10 years.
    It's probably been that long since I've used this technique, but i think it should work.
    You should consider welcoming your system to the 21st century by upgrading to a supported release ;-)
    If you used split to chop up your export file, use cat or dd to reassemble it.
    So, something like this:
    mknod bk.dmp p
    cat xaa xab xac xad xae xaf xag xah xai > bk.dmp &
    imp SYSTEM/$PASSWD parfile=imp_bk.parfile
    rm bk.dmp
    $ cat imp_bk.parfile
    file=bk.dmp
    log=imp.log
    full=y
    buffer=1048576
    ignore=y
    commit=y let us know if still have problems.
    Good Luck!

  • How to Rename the file in the application server?

    Hi friends.
    How to Rename the file in the application server? via abap program so pls kindly let me know thr any function module is there.
    Thanks
    With Regards
    I.Muthukumar.

    Dont think there is any quick fix way of doin this, however you can use the following sequence of dataset ops to get what you need:
    READ DATASET - retrieve contents of current AS file
    TRANSFER DATASET - create a new file on AS with the contents read in READ
    DELETE DATASET - delete the original file on AS (if TRANSFER above is successful)
    Hope this approach helps.
    Cheers,
    Aditya

  • Warning message when starting trial of After Effects: "Could not rename the file...in workspaces.

    I am trying to download the trial version of After Effects, and it goes through the whole download process fine. But as soon as I try to launch the application, I receive the message "After Effects warning: Could not rename the file '/Users/Rebekah/Library/Preferences/Adobe/After Effects/11.0/Workspaces.35974.1407352380644801.xml' to 'workspaces.xml'.
    What is causing this and what should I do? I've already tried uninstalling the trial and reinstalling it.
    Thanks!

    Having a similar problem as I try to use After Effects CC for the first time. "After Effects warning: Could not rename the file '/Users/timmyd/Library/Preferences/Adobe/After Effects/12.1/Workspaces.583.1407351854988961.xml' to 'Workspaces.xml'.
    When I navigate to the 12.1 folder, I see ModifiedWorkspaces and OriginalUserWorkspaces folders but no "/Workspaces.583.1407351854988961.xml".
    Then I attempted to open a project in AE CS6 (haven't use AE at all in months), I get a simliar message as the project is loading.  "After Effect error: Can't overwrite file"/Users/timmyd/Library/Preferences/Adobe After Effects 11.0-x63 Prefs". ( 3 :: 3 )
    When I click okay the project closes.

  • After Effects warning: Could not rename the file  . . .

    Mac pro 2x 2.66 Dual-Core
    Mac os10.5.8
    CS5 master collection install
    Please some help on this would be greatly appreciated.
    everything works except
    After Effects
    I get this message after launch:
    After Effects warning: Could not rename the file '/Users/michaelrutledge/Library/Preferences/Adobe/After Effects/10.0/Workspaces.1405.1407350763865601.xml' to 'Workspaces.xml'.
    followed by
    After Effects can’t continue: unexpected failure during application startup
    What I've tried:
    I've searched this forum found one thread that hasn't helped
    uninstalled entire Master Collection and reinstalled
    fixed permissions
    uninstalled and reinstalled just AE
    I am unable to change the prefs directory indicated to add .xml file for folder.
    Do not find Workspaces.1405.1407350763865601.xml
    I'm about to download the master collection again and try a fresh install of AE.
    Thank in advance for any help . . .
    M

    And what if you simply trash the whole prefs folder/ move it out of the way? AE should happily re-create everything with factory defaults. realyl sounds like one of your workspace files is damaged, perhaps due to a crash.
    Mylenium

  • OSB throwing IO Exception : Could not able to rename the file

    Hi, 
    I am trying to publish the file in an SFTP location. OSB is able to write the file with extension .a (which it generally does while writing), but couldn't able rename it to the original name.
    Error From Logs :
    BEA-381801> <Error occured for endpoint com.bea.wli.sb.transports.TransportException: File could not be renamed from: ./OSBSFLFiles/TestFileOSR.xml.a to: ./OSBSFLFiles/TestFileOSR.xml
    com.bea.wli.sb.transports.TransportException: File could not be renamed from: ./OSBSFLFiles/TestFileOSR.xml.a to: ./OSBSFLFiles/TestFileOSR.xml
    Caused By: java.io.IOException: File could not be renamed from: ./OSBSFLFiles/TestFileOSR.xml.a to: ./OSBSFLFiles/TestFileOSR.xml
    Solutions Tried :
    1) All the permissions are there to read and write on that folder.
    2) In the remote SFTP logs there is no activity recorded for attempting to rename the file from OSB.
    Please suggest.
    Thanks,
    Ankit

    Use a JCA adapter.
    Create adapter in Jdeveloper and import the artifacts in to OSB.
    The native support of OSB for SFTP doesn't work sometimes

  • Rename the file name of a Vault (not the Vault name)

    I have a Maxtor Sahred Storage Plus and I am now planning to use it for backing up Aperture. Yes, I now that Aperture is not made for back up on a network, but it should be possible according to this thread: http://discussions.apple.com/thread.jspa?messageID=2245775&#2245775
    My problem is that the filename of the vault is either to long or contains characters which the Maxtor do not accept so I can not copy the vault from Finder as suggested in the above thread. My question is if someone now if it is OK to rename the filename of the Vault?
    Macbook Pro   Mac OS X (10.4.7)  
    iBook   Mac OS X (10.4.6)  

    Hi,
    you can't.
    Except you save the file under a different name before you send it.

Maybe you are looking for

  • BPM worklist app views are not visible in IPM task viewer

    Hi, we upgraded our system from 11.1.1.3.0 to weblogic 10.3.5.0 SOA 11.1.1.5.0 with BPEL processes ECM with IPM and UCM 11.1.1.5.0 after upgrade i have problem with profiles in IPM task viewer page. Views are created in BPM worklistapp and all users

  • G/L Accounts Search

    Hi SAP gurus, I have a little problem with the G/L accounts search.  After creating G/L accounts for a particular company code, while testing for document entry using FB50, when I click on the drop down menu to search for the GL accounts i get a mess

  • Feature Request:   Preset Preview on Second Monitor

    Currently, when you have monitor 2 set on "Loupe" mode and it is set for a "Live" view, and then scroll across the filmstrip on monitor 1, you can see the images change on the second monitor. I would like to have the ability to set monitor 2 on "Loup

  • Can Apple provide manually setting resolution of Screen

    My LCD TV can support up to 1280*720 (16:9) but the result of auto-negotiate from OSX only support 1024*768 (4:3) Can I manually setting the resolution for my LCD TV ?

  • How do I store all iPhoto libraries on the iCloud?

    I believe I can save my photos to the iCloud in case of disaster.  How do I store ALL of my iPhoto libraries/events/photos on the iCloud?  It doesn't appear there are there when I look at iCloud.com. Thank you.