How to move a entire directory!

Hi, is there any direct or easy way to move a directory to another place. I guess that the File class should has a method Move, copy and things like that to make way this kind of tasks.
I guess that reading the FIle content, detecting is its folder or file, if is fil move it using a fileOutputStream, else entering the folder to do the same.
Doing this algorthym with recursivity is not as doing a helloWorld, so there should be a direct or at least more easy way to do it.

DrC was referring to moving between file systems: renameTo

Similar Messages

  • How to install an entire directory structure and files with the LabVIEW installer

    I think I may be missing something on how to do this - preserve a file directory structure in the LabVIEW build process.
    Is there an easy way to distribute an entire directory structure (multiple directory levels/text files) and have the LabVIEW build process properly preserve and install them?   I included a directory in my build specification but it completely flattened the file structure and then so when the installer builds it, the resulting structure in the /data directory is flattened as well.    I'd prefer not to go through each file (~100) and setup a specific target location.   Is there an easy way to preserve the file structure in the build process/installer process that I am missing (maybe a check box that I didn't see or an option setting somewhere)?
    -DC

    Hi DC
    Sorry for the delay in responding to your question.
    You should be able to do this using a 'Source Distribution' as described below:
     - Right click on 'Build Specifications' and select 'New' - 'Source Distribution'
     - Provide a name
     - Add your files to 'Always included' under 'Source Files'
     - Under 'Destinations' select 'Preserve disk hierarchy' and ensure that 'Directory' is selected as the 'Destination type'
    When building an installer your can then choose to include your source distribution and it will be installed to a location of your choosing.
    Hope this helps.
    Kind Regards
    Chris | Applications Engineer NIUK

  • How to indicate an entire directory to upload?

    Hi,
    My JSP application must allow that users can indicate an entire directory to upload, not single files. Any suggestion using JSP, AJAX or Javascript?
    For single files it´s easy, I can use <input type="file" ... >
    I can´t ask users to zip the directory and obtain a single file.
    Xks,
    Miguel

    Hi DC
    Sorry for the delay in responding to your question.
    You should be able to do this using a 'Source Distribution' as described below:
     - Right click on 'Build Specifications' and select 'New' - 'Source Distribution'
     - Provide a name
     - Add your files to 'Always included' under 'Source Files'
     - Under 'Destinations' select 'Preserve disk hierarchy' and ensure that 'Directory' is selected as the 'Destination type'
    When building an installer your can then choose to include your source distribution and it will be installed to a location of your choosing.
    Hope this helps.
    Kind Regards
    Chris | Applications Engineer NIUK

  • How to move my entire iphoto library and all albums and mobileme galleries to my new tower?

    What is the best way to move my entire iphoto library and all albums and mobileme galleries to my new tower?
    I want to move it smoothly without hours of reconfiguring albums and Mobileme galleries.  Already have a timemachine backup of the older iMac with the iphoto library.

    Connect the two Macs together (network, firewire target mode, etc) and drag the iPhoto library intact as a single entity from the old Mac to the pictures folder of the new Mac - launch iPhoto on the new mac and it will open the library and convert it as needed and you will be ready move forward.
    LN

  • How to move my entire music library to another drive?

    i bought a new faster, bigger drive and would like to move all the itunes stuff to that new hard drive
    Can i do it?
    How?
    Thank's

    http://support.apple.com/kb/HT1449
    Have fun!

  • How to move songs in one playlist from one mac to another?

    I am running the current version of  iTunes on my MacPro and my MBAir, both of which are authorized computers in my iTunes account.  I would like to copy the tunes in one playlist on my MacPro to my MBA, so that I can take them on the road.  Some of the songs are purchased from the iTunes store, and some have been ripped in from CDs I own.  I have found numerous links explaining how to move an entire iTunes library to a new computer.  But, I simply want to copy a few files from one Mac to another so that I can play them on either machine.  How do I do this?  Thanks!

    There are no shortcuts with the way your iTunes libraries are set up. You'll just have to go to each individual song, use "Show in Finder" to locate the actual file and copy and paste them to your other computer's iTunes.
    What I suggest for someone who has multiple computers is to designate one computer to store all of your iTunes content and use the Home Sharing feature to stream to the other computer. iTunes was not designed for an individual that has multiple computers.

  • Un-Lock entire directory of locked files

    I just got a new macbook pro, and when I popped my old secondary hard drive in, I notice that half of my mp3 files are now shown with a little lock next to them. I can manually un lock them one at a time, but I'm a professional DJ, and I have thousands of files.
    can anyone explain how to unlock an entire directory in one fell swoop? I didn't lock them to begin with, so this is aggravating.
    I cannot save bpm or cue points to files while they're locked. My serato scratch live software will also not save overviews while they're locked.
    Thanks!

    Thanks! over an hour and 3 transfers with apple care, and they still have me on hold. This fixed it.. I'm just waiting to tell the "genius" on the other end of the phone what fixed it!
    lol
    Thanks Niel.

  • How to move flat file after loading in owb to other directory with othernam

    Hi All,
    I wast struck in problem . after loading the flat file in owb that file should be move or rename or zip with Date everyday .
    I dont know how to achieve this issue in owb via proceudre or any other way ... .
    how to zip files from pl/sql procedure ...... with sysdate.zip.
    any one please help me in this problem to come out soon.
    thanks ,
    murari

    One way is to use a Java stored procedure, this can then be called from a map or a process flow. The Java stored procedure will use the Zip capabilities in Java to do what you need. For example you will need the following procedure and you will have to grant privileges for your file to ZIP and the entire directory for zipping into (since the file name will be dynamic):
    For example grant YOURSCHEMA (change to your tgt schema) read on your extract directory where your file to zip is and write on your zips directory (where the zips will go);
    exec dbms_java.grant_permission('YOURSCHEMA', 'SYS:java.io.FilePermission', 'c:\staging\extracts\*','read');
    exec dbms_java.grant_permission('YOURSCHEMA', 'SYS:java.io.FilePermission', 'c:\staging\zips\*', 'write' )
    You can then create your procedure which you can invoke
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "otnZipFile"
    AS
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    public class otnZipFile
    public static void zipFile(String zip, String filename)
    byte[] buf = new byte[1024];
    try {
    String outFilename = zip;
    ZipOutputStream out = new ZipOutputStream(new FileOutputStream(outFilename));
    FileInputStream in = new FileInputStream(filename);
    out.putNextEntry(new ZipEntry(filename));
    int len;
    while ((len = in.read(buf)) > 0) {
    out.write(buf, 0, len);
    out.closeEntry();
    in.close();
    out.close();
    } catch (IOException e) {
    create or replace PROCEDURE zip_file(
    dir IN VARCHAR2,
    file_name IN VARCHAR2) IS
    LANGUAGE JAVA NAME 'otnZipFile.zipFile(java.lang.String, java.lang.String)';
    For example here I zip a file MYCSV.csv into the zip file MYZIP.zip
    exec zip_file('c:\staging\zips\MYZIP.zip', 'c:\staging\extracts\MYCSV.csv');
    Cheers
    David

  • How do I move an entire app to a dual monitor? Not just a window?

    How do I move an entire app to a dual monitor? Not just a window? I can drag single windows, but if I move a window to the second monitor and hit a button, like 'New', that opens a new window, then it opens the window in the first monitor. I want it to open in the second monitor instead.

    Right. Mail remembers as well. I have the menubar set on my larger display, and the main Mail window on the MBP display. When I create a new message, it displays the composition window on whichever display I used the last time for composition. So after the first time I moved the composition window to the larger display, it always opens on that display. I can't remember if it remembers that behavior after taking the MBP on the road, where I use only its display, and then reconnect the second display back at home.
    Mark

  • How do I move my home directory to another disk?

    I want to find out the "standard procedure" for moving my home directory to another disk.  My current system disk is getting quite full, so I have purchased additional storage.  The issues I am concerned about are the following:
    Preserving the file permissions
    I have used rsync and ditto commands to copy the file.  Does rsync preserve the permissions like the ditto command?
    Updating the System to use the new home directory
    I have used the Ctl-Click on the accounts control panel to update the location of the home directories.  Do applications use "~<username>" or /Users/<username> to find the home directory of the user (obviously this is limited to Apple Controlled software).
    Understanding the /Users and /home directories
    Since Apple is no longer using netinfo, I wanted to get a better understanding how these directories are set up.  Is the /home directory exclusively for network mounted home directories.
    Please let me know if you have any questions.

    I disagree with Linc Davis on whether to move the home folder, But I think you are going about it the wrong way. 
    Having a Boot drive with only System, Library, Applications, and the hidden unix directories including Paging/Swap on it is one of the best ways to speed up routine disk Access for all your other files. The system keeps "snacking" away loading and reloading bits and pieces of System and Applications as you work, and that System activity slows "regular" disk access way down by moving the drive heads away from the files you are processing.
    Giving System files their own drive speeds up everything.
    Here are two good recipes and discussions about how and why to do this, and how to make it happen without a single line of Terminal code:
    http://chris.pirillo.com/how-to-move-the-home-folder-in-os-x-and-why/
    http://jcsenterprises.com/Japamacs_Page/Blog/00E03B83-1ADA-406E-A940-396D39F598E A.html

  • How to  move a page file to another directory ?

    Hi,
    What I did to try to move a page to another directory is:
    1. copy the page file to another directory /public_html/mydirectory.
    2. modify the nevigation-rule in the faces-config.xml file so that the nevigation-rule
    point to the file in the new directory.
    But when run the page, there is an FacesException: Cannt instantiate backing_bean.
    How to move a page file to another directory?
    Thanks
    Stephen

    besides moving the file to the new directory, i'd advise you to find the name of your page in every file of your application (ultraedit does this very well) and append the directory wherever it appears otherwise you'd probably miss a reference and have a problem like you have.

  • How to move a specific tablespace datafile from one directory to another

    Database: 10.2.0.1
    OS : Generic
    Problem Description : How to move a specific tablespace datafile from one directory to another considering that the database is on Oracle Dataguard setup
    ** Oracle is working on this issue, but in parallel is opening the topic to the Community so that Community members can add their perspective, experience or knowledge. This will further enhance all knowledge bases including My Oracle Support and My Oracle Support Communities **
    Edited by: ram_orcl on 16-Aug-2010 21:21

    Dear ram_orcl,
    Please follow the procedures here;
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14239/manage_ps.htm#i1034172
    8.3.4 Renaming a Datafile in the Primary Database
    When you rename one or more datafiles in the primary database, the change is not propagated to the standby database. Therefore, if you want to rename the same datafiles on the standby database, you must manually make the equivalent modifications on the standby database because the modifications are not performed automatically, even if the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO.
    The following steps describe how to rename a datafile in the primary database and manually propagate the changes to the standby database.
       1.
          To rename the datafile in the primary database, take the tablespace offline:
          SQL> ALTER TABLESPACE tbs_4 OFFLINE;
       2.
          Exit from the SQL prompt and issue an operating system command, such as the following UNIX mv command, to rename the datafile on the primary system:
          % mv /disk1/oracle/oradata/payroll/tbs_4.dbf
          /disk1/oracle/oradata/payroll/tbs_x.dbf
       3.
          Rename the datafile in the primary database and bring the tablespace back online:
          SQL> ALTER TABLESPACE tbs_4 RENAME DATAFILE      2> '/disk1/oracle/oradata/payroll/tbs_4.dbf'
            3>  TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
          SQL> ALTER TABLESPACE tbs_4 ONLINE;
       4.
          Connect to the standby database, query the V$ARCHIVED_LOG view to verify all of the archived redo log files are applied, and then stop Redo Apply:
          SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
          SEQUENCE# APP
          8 YES
          9 YES
          10 YES
          11 YES
          4 rows selected.
          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
       5.
          Shut down the standby database:
          SQL> SHUTDOWN;
       6.
          Rename the datafile at the standby site using an operating system command, such as the UNIX mv command:
          % mv /disk1/oracle/oradata/payroll/tbs_4.dbf /disk1/oracle/oradata/payroll/tbs_x.dbf
       7.
          Start and mount the standby database:
          SQL> STARTUP MOUNT;
       8.
          Rename the datafile in the standby control file. Note that the STANDBY_FILE_MANAGEMENT initialization parameter must be set to MANUAL.
          SQL> ALTER DATABASE RENAME FILE '/disk1/oracle/oradata/payroll/tbs_4.dbf'
            2> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
       9.
          On the standby database, restart Redo Apply:
          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
            2> DISCONNECT FROM SESSION;
    If you do not rename the corresponding datafile at the standby system, and then try to refresh the standby database control file, the standby database will attempt to use the renamed datafile, but it will not find it. Consequently, you will see error messages similar to the following in the alert log:
    ORA-00283: recovery session canceled due to errors
    ORA-01157: cannot identify/lock datafile 4 - see DBWR trace file
    ORA-01110: datafile 4: '/Disk1/oracle/oradata/payroll/tbs_x.dbf'Hope That Helps.
    Ogan

  • How can I move my entire iTunes library from old laptop to new one?

    I got a new iPad for Xmas to replace an old laptop not realising I would still have to have a laptop or PC for my main iTunes library. I have got round ths by creating my own area on my partner's laptop &amp; have installed my iTunes library on there. However, it has only installed my purchased music &amp; not my wider collection such as all my CD's that I burned then got rid of to go digital. I have my complete library on my iPad &amp; iPhone but need it on my laptop too in case I lose or break a device &amp; need to install my iTunes library to a new device.
    I have followed the support detailing how to move your iTunes to a new computer but am not getting very far. I don't have an iPod to use as an external hard drive. I read that you can drag your iTunes library to a CD or DVD but my library is 16GB &amp; I don't have any disc big enough!
    Does anyone have an idea of a simple way I can do this? Is it not possible to do it directly from my iPad or iPhone seeing as my complete library is on both of these devices?

    Before you connect any device to a new library go to the Devices tab of the the preferences panel via Edit > Preferences (Windows) or iTunes > Preferences (Mac) and ensure the box next to Prevent iPods, iPhones, and iPads from syncing automatically is ticked. You can now safely connect the device to your computer without the danger of media being automatically deleted or overwritten.
    To get all your content off your connect your iPad to your new computer.
    Then use a 3rd party piece of software to transfer your content
    I have found Senuti useful but there are others listed in the article I linked to in a previous post.
    https://discussions.apple.com/docs/DOC-3991
    That will let you transfer your non purchased content
    For Purchased content log in to iTunes on the new computer
    In Itunes Store click on Purchased under the Quick Links section on the right.
    Download any music by clicking on the cloud button

  • How to upload entire Directory / Multiple Files

    Dear Friends,
    I am trying to design a very user friendly servlet page for uploading multiple files from a PC to Unix server. I need some suggestion on what java library or ftp client to use for this.
    Details:
    There are about 8 files to upload (sized ranging from 200kb to 60MB, The files are a mix of binary and ascii data). I don't want the user to have to click on the browse form button on the webpage 8 times to select the files. In fact all of the files will reside in a directory with a barcode as the name.
    I would like to have the user simply select the directory and submit the form. I will then have a parser that is automatically invoked to parse these files, verify the formats and use the data to populate the next page that is shown to the user for data confirmation.
    The hardest part for me is figuring out what tool to use for the upload section. Any suggestion on what tool (FTP client library, etc.) would be highly appreciated.
    In the forum I found lots of examples for uploading single files but none for uploading entire directory or just multiple files. Am I asking the wrong question? Are there any example out there that I can look?
    I do not favor using a full blown ftp tool on the side because I think it increases the chance for user errors. (miss selecting a file, wrong directory, ascii vs binary).
    Thanks,
    Wayne Chen
    [email protected]

    There are two ways to upload multiple files:
    1. Package them all into a zip file on the client, upload that file, unpackage them on the server.
    2. Upload one file at a time.
    If you're asking about servlets then you can't do number 1 because you can't access the files on the client. And you've said you don't want to have the client upload the files one at a time. From this it follows that you need some logic on the client that can either zip and upload the files, or upload the files one at a time, without requiring user intervention. The Java form of client-side logic from a website is an applet. In this case you would have to sign the applet, since an applet can't access the client's file system without the client's permission.

  • Does MacOS recognize Windows directory structure? Can I move an entire folder (consisting of subfolders and files) from Windows to Mac?

    Can I move an entire folder (consisting of subfolders and files) from Windows to Mac?

    Mustafafromnc,
    if you’re talking about a USB drive, then it will probably have an exFAT filesystem. Modern versions of OS X can read from and write to exFAT filesystems without problems, so you would be able to move Windows folders, subfolders, and files from an exFAT filesystem to an OS X filesystem.

Maybe you are looking for

  • Envelopes

    Hello: I posted this a couple days ago in another forum and have had no response, so I"m thinking it was the wrong place. This forum makes more sense. To save time at the bank filling out repetitive information on a bank envelope for ATM deposit, I'm

  • Smartform In Landscape

    Hello Everybody, I have created a label of size 6X4 inches. I want the label to be printed in landscape. But thats not happening. I have set the printer in protrait. Can someonet tell me what has to be done. All the help is appreciated. Thanks, Sneha

  • HT6181 safari 7.0.3 not opening

    I have safari 7.0.3 and it will not open. Here is the problem report. Process:         Safari [654] Path:            /Applications/Safari.app/Contents/MacOS/Safari Identifier:      com.apple.Safari Version:         7.0.3 (9537.75.14) Build Info:     

  • Help me Developers  on sessionFacade and Business delegate

    Dear All What is the difference B/w sessionFacade and Business delegate pattern .I have gone through the tutorial.

  • How to change kernel-logo ?!?

    Well I found some cmds to create a clut-224 image. But how to create the mono and vga16 image you did guys? [phil@philstv-desktop DEV]$ pngtopnm -plain chakrafb.png > chakrafb.pnm [phil@philstv-desktop DEV]$ ppmquant -plain 224 chakrafb.pnm > chakraf