Results 1 to 5 of 5
  1. #1
    rajeshgubba is offline Member
    Join Date
    Apr 2008
    Posts
    7
    Rep Power
    0

    Default How can i copy a folder from one place to another..

    Hi,

    How can i copy the folder from one place to another place..

    Including its subfolders and files....

    Using java code...

    please help me...

  2. #2
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    Take a look at File Class... there is a mkdir() method there... have some experiments on it....

    About copying files, also have a look at FileChannel Class.... it is more safer to implement....

    regards,
    sukatoa

  3. #3
    jad
    jad is offline Member
    Join Date
    Jun 2008
    Posts
    2
    Rep Power
    0

    Default folder backup in java

    how do i make folder backup in jave by copying each hour only the changes occured on the folder or subfolder(s),and by folder cloning

  4. #4
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    You may persist/save a log file with a data that represents the exact length/size of those files inside the folders/subfolders.

    Implementing it with thread is safe. you may use sleep(long hour) method to make the thread fall a sleep every hour. After every interval, check the files inside those folders if their size have been changed by comparing them with the data inside that log file.

    If yes, then do the copy....
    freedom exists in the world of ideas

  5. #5
    ferranb is offline Member
    Join Date
    Jun 2008
    Posts
    22
    Rep Power
    0

    Default

    Another dirt way is executing an operating system command. Of course, it means you have to consider all your target operating systems.

    Ferran

Similar Threads

  1. Replies: 2
    Last Post: 03-03-2008, 08:05 PM
  2. add password to folder
    By ismailsaleh in forum AWT / Swing
    Replies: 1
    Last Post: 01-08-2008, 05:46 AM
  3. How to place panel into frame
    By vivek_9912 in forum AWT / Swing
    Replies: 2
    Last Post: 11-19-2007, 11:21 PM
  4. how to place a divider of the splitpane?
    By christina in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 07:41 PM
  5. how to place an image in an applet
    By paty in forum Java Applets
    Replies: 2
    Last Post: 08-04-2007, 05:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •