How to move a file to a different folder in webdynpro?

Hi all
i ve created a file in some folder using fileoutput stream(). now i want to delete this file from folder  and copy that file into some different folder.
can anyone tell me.How to delete and move a file?

try {
     File inputFile = new File("C:\test\fold1\abc.txt");
     File outputFile = new File("C:\test\fold2\def.txt");
     FileInputStream in = new FileInputStream(inputFile);
     FileOutputStream out = new FileOutputStream(outputFile);
     FileChannel inc = in.getChannel();
     FileChannel outc = out.getChannel();
     inc.transferTo(0, inc.size(), outc);
     inc.close();
     outc.close();
     in.close();
     out.close();
     boolean fileDeleteSuccess = inputFile.delete();
     if(!fileDeleteSuccess)
          System.out.println("File couldnot be deleted");
     else
          System.out.println("File deleted!!");
     } catch (FileNotFoundException e) {
     e.printStackTrace();
     } catch (IOException e) {
     e.printStackTrace();

Similar Messages

  • How to move xml files to a particular folder?

    I have made XML forms for new which is having approval feature.
    Now i want that  after the approver approves the news ,the respective xml file of the approved news should move to a particular folder defined by me in KM.
    Is it possible....?If yes, how?

    Hi
    Other way of achieving this is to create a repository service which listens to the publish event. You can write the code to move document in the received method of repository service. If any document is published, event will be triggered and the service will be invoked, the code to move the document will be executed.
    Check the link:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30143cc1-d176-2a10-55a3-ea498211e424
    Regards,
    Yoga

  • How to move pdf files into iCloud drive folder

    Now that we can have a folder called, say "personal" with pages, numbers and other files in - how can I get my pdf files that are currently in iBooks into these iCloud drive folders. I don't even know where the pdfs from iBooks are! Certainly not in iTunes. I have many dozens of pdfs which could do with sorting into folders with their relevant notes that I make in Pages. I have an IPad Air and an iPad with Yosemite.

    Thanks, Niel, though I underspecified the problem a bit because I knew how to do the rest in Automator; unfortunately, I know even less about Applescript.
    How do I also specify that the file names must begin with a specific text string (e.g. "journal.").
    John

  • Ant ; how to move nonjava files to the output folder whn i comile java file

    Hi when i compile my java file using javac ant task, i want to move non java file to the same output folder where the dot class file are stored. example if a package has 2 java file and a .properties file, when i javac task compile that package .properties file should move where the .class files are moving. can anyone help me please

    An ant target can carry out multiple tasks. You need to put the <javac> and <copy> tasks in the same target in your ant file.

  • How to move data files out of Users folder that is in a small partition?

    The small partition (50 GB) also has the System, Applications, Developer and Library folders. I would like to move my Documents, Pictures, etc folders from this small partition to the 200 GB partition, preferably without losing too much performance. Does it work just to physically copy them to the other partition and then delete from the Users folder, or does that create problems? I have read somewhere that this may cause a lot of disk searching delays or other more serious problems. Before I reformat the whole HD to a single partition, is there a faster, less drastic solution? Thanks.

    I presume I need to use "file-level" copying to the one-partition drive, but is there anything else to consider?
    Yes, if you're talking about CCC, then file level is all you can do copying from the drive you'r booted from, but normally best anyway as the copied files will be unfragmented.
    When failures occur, I presume they are due mainly to mechanical failures of the drive mechanism, but do "volume failures" occur very frequently?
    Very astute! It's rarely possible to just lose one partition & not others, but if it is HW failure on the HD, then likely all will be lost.
    or perhaps to a format that can be read by all platforms (other software needed for that?
    Actually, your Intel Mac can boot from an APM partition, you just can't install to it or do Firmware updates from it, but it saved my behind when my only IntelMac died recently & I gad everthing 10.5.8 on an APM Firewire drive, I just plugged it into my eMac & had everything available.
    Of course99.9% of PPC Macs can't boot OSX from USB, & cannot run/boot 10.6.x
    A few options...
    You could format that HDD as Fat32/MS-DOS, but you'd be limited to 4 GB Filesizes.
    NTFS-3G Stable Read/Write Driver...
    http://www.ntfs-3g.org/
    MacFUSE: Full Read-Write NTFS for Mac OS X, Among Others...
    http://www.osnews.com/story/16930
    MacDrive for the PCs... allows them to Read/Write HFS+...
    http://www.mediafour.com/products/macdrive/

  • HT201361 Is it possible to save the screenshot files to a different folder than desktop. How can I change the folder?

    Is it possible to save the screenshot files to a different folder than desktop (that is the default). How can I change the destination folder? Thank you, Sal

    To change the screenshot capture location to a new place on your Mac, first think of a location that would serve you properly. We like to place ours in a "Screenshot" folder located inside of the User's "Pictures" folder. To change the location to this new location, open the Terminal and enter the following command:
    defaults write com.apple.screencapture location /Users/[u]/Pictures/Screenshots/
    Replace "[u]" with the name of the user on your system. Once you have entered this command, let's restart the screen capture utility by restarting the SystemUIServer by entering the following command:
    killall SystemUIServer
    You can optionally log out and back in instead of entering this second command, thus restarting the SystemUIServer. Once restarted, all screen captures taken from here on out will end up in your /Pictures/Screenshots/ folder in the User's home folder on your Mac.

  • How to move all files in Organizer to a network location

    I have a fairly large catalog with about 20 album categories, each with between 5 and 15 albums, totalling about 20,000 photos, all currently residing on my laptop. I need to move everything to a networked drive but can't find how in the Elements help system. Is there a quick and easy way to do this?
    Message title was edited by: Brett N

    If you have a complex folder structure, it may be best to do the backup/restore as this gives you the option of recreating the same folder structure at the destination location. If folder structure is no concern (that all files can just go to a single folder because you are using Albums instead), then the File > Copy/Move to Removable Drive command would be easiest. Just select the Move option and then choose your Network drive as the Destination Drive, use the Browse button to move the files to a specific folder on that drive.

  • Any way to re-dnld purchased music? had program change and somehow music went to My Pic's Folder which of course can't be used. Can't figure how to "move" the file around.  Have Windows XP..

    any way to re-dnld purchase music from itunes to computer? had a program change and somehow previously purchase music went into My Photos File. ???? do not know how !  can't figure out how to move the music to the itunes folder.

    Yes, visit this link.  It should help.
    Downloading past purchases from iTunes

  • How to move PDF file from Spool to Application Server?

    How to move PDF file from Spool to Application Server?
    Cannot use RSTXPDFT4 because that converts OTF to PDF and the file is already PDF.
    RSTXPDFT5 doesn't work. It picks the file up and assigns it a 'text' type and outputs a 1 line txt (1kb in size) on the server with the spool number in it!
    The program which outputs the file to the spool, in the first place, uses adobe forms and outputs to a printer of type PDF.

    Hi Gemini ,
    Please refer the below links.
    [http://sap.ittoolbox.com/groups/technical-functional/sap-hr/convert-a-spool-to-pdf-and-save-on-application-server-in-background-720959]
    [http://www.sapfans.com/forums/viewtopic.php?f=13&t=325628&start=15]
    Edited by: Prasath Arivazhagan on Apr 13, 2010 4:48 PM

  • How to move downloaded files from download folder to other relevant folder or how to download files in relevant folders other than download folder

    how to move downloaded files from download folder to other relevant folder or how to download files in relevant folders other than download folder

    Just drag the file from the Download folder to the folder of your choice in Finder. If you are using Safari you can designate a new default download destination in Safari>Preferences>General tab, 'Save Downloads to...'. Other browsers should have a similar option in their preferences.

  • How to move all files but X to Y

    It doesn't really matter if it's in the terminal or if it's a applescript but I need to know how to:
    Move all files in a dictionary but a few named.

    Could you pleas explain more?
    If you do not understand the shell while loop, it is possible that using shell commands is a bit more dangerous than you might want to try.
    The explanation:
    ls -a | grep -v "X" | while read file
    do
        mv "$file" "Y/"
    done
    ls -a will list all the files in the current working directory (including the invisible files that start with a leading period.  Thinking about this, maybe you do not want to include -a.  You could cd /path/to/the/desired/directory as a way to set your current working directory as the directory you wish to move things from
    cd "/path/of/the/from/directory"
    ls | grep -v "X" | while read file
    do
        mv "$file" "Y/"
    done
    The ls command's output is piped (the vertical bar | ) into the grep command (general regular expression parser).  The -v option tells grep to throw away any lines (filenames) that match the regular expression "X".  So if the regular expression X matches all the files you do not want to move, the filenames send to the next pipe will be the files you wish to move.
    The while loop will read the filenames grep has selected and invoke the mv (move) command for each file selected by grep and move them to the destination directory Y
    The bigest risk is that you will execute this in the wrong directory and move the files that you need somewhere else.  OR WORSE, if "Y" is NOT a directory, and you DO NOT put a trailing / the mv could move easy file to the destination file, deleting the previous file for each file moved, so effectively deleting every file in the directory except the last one.
    This is why I said if you do not understand what is going on with the shell commands, you could do damage to your system.
    ls could have the /path/of/the/from/directory instead of using the cd command.  The grep command could be replaced with egrep that allows using alternate matching strings:
    ls /path/of/the/from/directory | egrep -v "abc.txt|def.jpg|xyz.mp3|etc..." | while read file
    do
        mv "$file" "/path/to/the/destination/directory/"  # notice the trailing slash for safety
    done
    Good luck.  I hope you do not destroy your system

  • How to move all files to the top level folder?

    I want to move all files within a particular folder -- and all files in all sub folders -- to the top level. i.e. I want to collapse the folder structure to just one folder. Assume that there are no files with the same name.
    *Method 1*
    My first thought was to use Find:
    1. Limit Find to the particular folder.
    2. Find all files in the folder with Size > 0.
    3. Switch to List view. All files are listed.
    4. Select all files and drag to the top folder
    5. Delete all sub folders manually.
    Problem: Pages files are not found, and maybe others aren't.
    This is a simple method and I'd like to stick with it.
    *QUES 1*
    What condition should I set within Find so that I can be guaranteed of finding all files?
    *Method 2*
    It was suggested in another thread that I use Terminal to move all files to the top level, but I couldn't get it to work. And there was a problem with files that consist of bundles.
    *QUES 2*
    What is the easiest way to consolidate all files within a folder to the top level -- assume no duplicate names -- and at the same time remove all sub folders?
    Message was edited by: Guy Burns

    Thanks for the suggestion of EasyFind.
    To find all files in a certain folder I typed in *[a-z 0-9] as a Boolean search (this thread won't let me post the exact characters required by EasyFind). That should cover every file I've ever named. EasyFind came back with "11719found/12316done".
    Any idea what the missing 500 files would be? I'm hoping they are files that I don't need to know about (invisible files, system files and so on).
    Message was edited by: Guy Burns

  • How to generate PNG file to the disk folder by IBOT?

    Is there a piece of code in JavaScript on how to generate PNG file to the disk folder by IBOT?
    thanks a lot

    Please disregard this message. The information below is only semi-accurate. When I get some kinks worked out I'll edit this again. -Bill
    FYI,
    Don't really know if I'm adding anything useful but here it is. I use NetBeans and I simply added an images folder so now I have my package (deckofcards) and a sub package deckofcards.images.
    The image:
    back: Image {
                url: "{__DIR__}images/B.JPG",
                backgroundLoading:true
                placeholder:bind placeholder
            };works and the value of "{__DIR__}images/B.JPG" becomes
    <CARD backUrl="jar:file:/C:/Users/Bill/Documents/NetBeansProjects/DeckOfCards/dist/DeckOfCards.jar!/deckofcards/B.JPG">
      ...when I marshal. That string (backUrl) will unmarshal correctly and can be use in the url variable to display and image too.
    -Bill
    Edited by: bthayer on Feb 21, 2009 6:04 AM

  • How to move back microsoft in the original folder

    How to move back microsoft in the original folder?

    Microsoft Office? The applications themselves go into Applications>Microsoft Office 2011.
    Why did you move them? You may need to install anew if you've moved the applications in the suite.
    Clinton

  • How to move all files from a folder for a user to a centralized folder on a core server

    Hello,
    I'm curious if there is a batch file that can be made to move the contents that are setup like this....
    I'm having to redo a TS cluster and I'd like to make a batch file script that can be executed that moves the contents of say 'jsmith's local desktop profile @ \\NGTTS1\users\jsmith to a centralized folder on our roaming desktop profile server that saves
    all of the files for the desktops @ \\NGTFS1\users\jsmith.
    The problem I have is no matter what I tell users to save there files to our Y drive that is a folder that is synced across all 6 of our TS servers, users still store files on there desktops, so as you can imagine if one day they are on one server, then
    next day they could be on another and there files aren't the same.... hence the reason why I want to move all there files to the centralized server so when I redo the profiles from scratch on the TS server in the farm they suck files from the core server and
    have all of the files they are used to having.... 
    Now I know I can do this with a MOVE command I've just never done one to this exact.
    Hopefully someone knows the command to move all the contents of one folder on one server to the folder on a different server. I've already got the bulk of the coding done of the .bat script I just don't know this move command:
    would it be this:
    move \\NGTTS1\users\jsmith *.* \\NGTFS1\users\jsmith
    any help would be appreciated, I'm sure this is a easy command to do!
    This is the coding I have so far....
    @echo off
    color 0A
    title Moving Local Profile folder to Centralized Profile Folder on Core Server.
    :start
    echo Welcome, %USERNAME%
    echo What would you like to do?
    echo.
    echo 1. Moving Local Profile folder to Centralized Profile Folder on Core Server
    echo. 
    echo 0. Quit
    echo.
    set /p choice="Enter your choice: "
    if "%choice%"=="1" goto Move-user-profiles
    echo.
    if "%choice%"=="0" exit
    echo Invalid choice: %choice%
    echo.
    pause
    cls
    goto start
    :Move-user-profiles
    echo.
    set /p profile="Enter user profile: "
    move "\\NGTTS1\users\%profile%" *.* "\\NGTFS1\users\%profile%"
    echo moving files from local profile folder to FS1 profile server, stand-by...
    echo.
    goto cancel-special 
    :cancel-special
    set /p cancel="Type cancel to stop action: "
    if not "%cancel%"=="cancel" exit
    cls
    echo Action is cancelled.
    echo.
    pause
    exit

    In Windows we would do this using Group Policy.  There is a Policy setting that csn move the Desktop folder to any server you want to move it to.  Once set it will automatically do this for you.
    You should post in the Group Policy forum to find out how we use Group Policy to manage users profiles in Windows.
    You cannot use a script to relocate a users Desktop folder.  The desktop is locked by the time the users logon script is finished running.  It the desktop and profile are already being managed by Group Policy then this can only be done with GP.
    There are also numerous issues associated with deployment and re-deployment that you need to address  Post your questions in the Winows Deployment forum to get assistance with deployment issues.
    Again - want you are asking is not generally possible because of how Windows is designed.  This would only likely work on a simple system or on a stand alone PC and then only under a very limited set of circumstances.
    Use GP folder redirection to do this.  For deployment use Deployment Forum and for TS specific issues post in the RDS forum. 
    All of  this needs to be considered correctly for TS users inn a TS Cluster environment. (TS Cluster?? - not sure what you mean by that.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • How to Export data from a Table to Excel using PL/SQL Code

    Hi, I need to export data from a table to the excel sheet using PL/SQL script. could you pls provide with custom codes or sample procedures. Bobby

  • Adobe Edge installation problem

    I downloaded Adobe Edge Animation installer in my PC with Windows 7 and, three times I tried install it, without success. All time this message appears: "Founded following problem: fail error on installation of creative cloud desktop. (Error 1)" Some

  • Error 87

    hello i tried enabling dotnet feature in windows 8 but error message appeared Deployment Image Servicing and Management tool Version: 6.2.9200.16384 Image Version: 6.2.9200.16384 Error: 87 The limitacces option is not recognized in this context. befo

  • CS4 Page size fit in window

    Hi. The page sizing to fit the page you are working on has changed from the bar at the bottom to the bar at the top. What I am wondering is ... is it possible to permanently change the numbers in that window so I don't have to type in 90% or 85% each

  • Passing Field Symbols in subroutines

    Hi all, Can any body tell me how to pass field symbols in a suboutine and will that effect orignal value of that symbl if i change it in subroutine. Any Help will be awarded. <b>Sachin</b>