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 8 of 8

Thread: Program that moves files

  1. #1
    Junior Member
    Join Date
    Jul 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Program that moves files

    Hello, im new to programming java in general. Therefor im asking you guys for help.

    I want to make a program that can move files.

    I have an idea and ive been working around in photoshop to make a picture of what i want it to look like:

    moving.jpg

    Please help me with this


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Program that moves files

    a program that can move files.
    Do you mean: copy a file from one directory to another and then delete the original?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jul 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Program that moves files

    yes but i havent coded java before so idk what to do :O

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Program that moves files

    i havent coded java before
    Then it will take you a while to learn how.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Jul 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Program that moves files

    Is there a section where you can request programs like this or is there a version that can be downloaded anywhere? ive been looking on google for a while but cant seem to find it

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Program that moves files

    Sorry, this forum is for helping beginning java programmers with problems they are having with the code they are writing. I have no idea where to find the program you are looking for.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7

    Default Re: Program that moves files

    // Java program to illustrate renaming and
    // moving a file permanently to a new loaction
    import java.io.*;
    import java.nio.file.Files;
    import java.nio.file.*;

    public class Test
    {
    public static void main(String[] args) throws IOException
    {
    Path temp = Files.move
    (Paths.get("C:\\Users\\Mayank\\Desktop\\44.txt"),
    Paths.get("C:\\Users\\Mayank\\Desktop\\dest\\445.t xt"));

    if(temp != null)
    {
    System.out.println("File renamed and moved successfully");
    }
    else
    {
    System.out.println("Failed to move the file");
    }
    }
    }

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Program that moves files

    Old thread closed
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 1
    Last Post: June 20th, 2013, 01:45 PM
  2. Replies: 0
    Last Post: June 1st, 2013, 10:03 AM
  3. Tic-Tac-Toe Invalid Moves
    By XP360 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: April 11th, 2013, 10:33 AM
  4. How to represent a chain of moves?
    By maikeru in forum Collections and Generics
    Replies: 0
    Last Post: December 31st, 2009, 01:24 AM
  5. Method for legal moves in connect four.
    By mandar9589 in forum Algorithms & Recursion
    Replies: 3
    Last Post: December 27th, 2009, 05:28 PM