Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help to move a file

 
Tex Abrey
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
}
%>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic