Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Moving files between two folders

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Moving files between two folders

    I want to make a programm which movies files( .xml, .txt ) from one folder and dumps it into another. I googled it but not could not find it. This is my first task been assigned in office for my first job. Would be really glad if get some ideas on how to do it. I have basic knowlege of programming.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Moving files between two folders

    See the API for File, it has several methods that will help you (in particular, renameTo)
    http://docs.oracle.com/javase/6/docs...a/io/File.html

  3. #3
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: Moving files between two folders

    This is an interesting link that may help you: How to move file to another directory in Java

    Feel free to ask any questions you may have about what the link explains, and remember not to test the solution(s) on files without backing them up first (just in case).
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

Similar Threads

  1. Seraching through files in a folder for a pattern match inside the files.
    By dazzabiggs in forum What's Wrong With My Code?
    Replies: 4
    Last Post: May 2nd, 2011, 08:35 AM
  2. Replies: 1
    Last Post: March 22nd, 2011, 06:59 PM
  3. WatchService - small code for monitoring folders
    By zincc in forum What's Wrong With My Code?
    Replies: 5
    Last Post: March 8th, 2011, 10:19 AM
  4. Moving files to a single list iteratively
    By Growler in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: October 22nd, 2010, 10:08 AM
  5. Moving files in a Directory
    By Sai in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: March 23rd, 2010, 04:49 AM