This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSP and the fly likes help to move a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "help to move a file" Watch "help to move a file" New topic
Author

help to move a file

Tex Abrey
Greenhorn

Joined: Oct 04, 2002
Posts: 24
I am using this code and all i get is False returned when i try and use the renameTO() method
<%-- java include files --%>
<%@ page import="java.io.*" %>
<%@ page import="java.io.File" %>
<%
//starts going through the list of pdf files
File old = new File("/inet/docroot/CorporateResources/Newsclippings/upload/02-01-11_R01.pdf");
File moved = new File("/inet/docroot/dabrey/Newsclippings/clippings/02/01/02-01-11_R01.pdf");
out.println(moved);

try{
boolean flag = false;
flag = old.renameTo(moved);
out.println(flag);
}
catch(Exception e) {
System.out.println(e);
}
%>
 
GeeCON Prague 2014
 
subject: help to move a file