title: How can I move files to another folder with java?
body: <p>I want to move files (images) from a folder to another:</p>
  
  <p>For example:</p>
  
  <blockquote>
    <p>/home/folder1/image.png</p>
  </blockquote>
  
  <p>to</p>
  
  <blockquote>
    <p>/home/folder1/folder2/image.png</p>
  </blockquote>
  
  <p>And obviously remove the image from the folder1</p>
  
  <p>I've trying to do it by reading the path and then modifying it, or using renameTo, but i can't do it.</p>
  
  <p>I hope someone can help me a little with this, Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>Well I can put the code but it's simple to explain what i did:</p>
  
  <p>I just created a Folder class that has a File object of my folder (/home/folder1) , i read all the images inside and save it in an File array, then i scan it and try to change the path of every image file String to another</p>
  
  <p>EDIT:</p>
  
  <p>Thanks to all for the help, all are good examples, I was able to change my files to another location, there was a bunch of files I wanted to move so, I didn't want to create too many objects.</p>