Java Doc for Move.java in  » Build » ANT » org » apache » tools » ant » taskdefs » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » ANT » org.apache.tools.ant.taskdefs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.tools.ant.taskdefs.Copy
   org.apache.tools.ant.taskdefs.Move

Move
public class Move extends Copy (Code)
Moves a file or directory to a new file or directory. By default, the destination file is overwritten if it already exists. When overwrite is turned off, then files are only moved if the source file is newer than the destination file, or when the destination file does not exist.

Source files and directories are only deleted when the file or directory has been copied to the destination successfully. Filtering also works.

This implementation is based on Arnout Kuiper's initial design document, the following mailing list discussions, and the copyfile/copydir tasks.


since:
   Ant 1.2



Constructor Summary
public  Move()
     Constructor of object.

Method Summary
protected  voiddeleteDir(File d)
     Go and delete the directory tree.
protected  voiddeleteDir(File d, boolean deleteFiles)
     Go and delete the directory tree.
protected  voiddoFileOperations()
     Override copy's doFileOperations to move the files instead of copying them.
protected  booleanokToDelete(File d)
     Its only ok to delete a directory tree if there are no files in it.
protected  booleanrenameFile(File sourceFile, File destFile, boolean filtering, boolean overwrite)
     Attempts to rename a file from a source to a destination. If overwrite is set to true, this method overwrites existing file even if the destination file is newer.
protected  voidvalidateAttributes()
     .


Constructor Detail
Move
public Move()(Code)
Constructor of object. This sets the forceOverwrite attribute of the Copy parent class to true.




Method Detail
deleteDir
protected void deleteDir(File d)(Code)
Go and delete the directory tree.
Parameters:
  d - the directory to delete



deleteDir
protected void deleteDir(File d, boolean deleteFiles)(Code)
Go and delete the directory tree.
Parameters:
  d - the directory to delete
Parameters:
  deleteFiles - whether to delete files



doFileOperations
protected void doFileOperations()(Code)
Override copy's doFileOperations to move the files instead of copying them.



okToDelete
protected boolean okToDelete(File d)(Code)
Its only ok to delete a directory tree if there are no files in it.
Parameters:
  d - the directory to check true if a deletion can go ahead



renameFile
protected boolean renameFile(File sourceFile, File destFile, boolean filtering, boolean overwrite) throws IOException, BuildException(Code)
Attempts to rename a file from a source to a destination. If overwrite is set to true, this method overwrites existing file even if the destination file is newer. Otherwise, the source file is renamed only if the destination file is older than it. Method then checks if token filtering is used. If it is, this method returns false assuming it is the responsibility to the copyFile method.
Parameters:
  sourceFile - the file to rename
Parameters:
  destFile - the destination file
Parameters:
  filtering - if true, filtering is in operation, file willbe copied/deleted instead of renamed
Parameters:
  overwrite - if true force overwrite even if destination fileis newer than source file true if the file was renamed
exception:
  IOException - if an error occurs
exception:
  BuildException - if an error occurs



validateAttributes
protected void validateAttributes() throws BuildException(Code)
.



Fields inherited from org.apache.tools.ant.taskdefs.Copy
final static String LINE_SEPARATOR(Code)(Java Doc)
final static File NULL_FILE_PLACEHOLDER(Code)(Java Doc)
protected Hashtable completeDirMap(Code)(Java Doc)
protected File destDir(Code)(Java Doc)
protected File destFile(Code)(Java Doc)
protected Hashtable dirCopyMap(Code)(Java Doc)
protected boolean failonerror(Code)(Java Doc)
protected File file(Code)(Java Doc)
protected Hashtable fileCopyMap(Code)(Java Doc)
protected FileUtils fileUtils(Code)(Java Doc)
protected boolean filtering(Code)(Java Doc)
protected boolean flatten(Code)(Java Doc)
protected boolean forceOverwrite(Code)(Java Doc)
protected boolean includeEmpty(Code)(Java Doc)
protected Mapper mapperElement(Code)(Java Doc)
protected boolean preserveLastModified(Code)(Java Doc)
protected Vector rcs(Code)(Java Doc)
protected int verbosity(Code)(Java Doc)

Methods inherited from org.apache.tools.ant.taskdefs.Copy
public void add(ResourceCollection res)(Code)(Java Doc)
public void add(FileNameMapper fileNameMapper)(Code)(Java Doc)
public void addFileset(FileSet set)(Code)(Java Doc)
protected void buildMap(File fromDir, File toDir, String[] names, FileNameMapper mapper, Hashtable map)(Code)(Java Doc)
protected Map buildMap(Resource[] fromResources, File toDir, FileNameMapper mapper)(Code)(Java Doc)
public FilterChain createFilterChain()(Code)(Java Doc)
public FilterSet createFilterSet()(Code)(Java Doc)
public Mapper createMapper() throws BuildException(Code)(Java Doc)
protected void doFileOperations()(Code)(Java Doc)
protected void doResourceOperations(Map map)(Code)(Java Doc)
public void execute() throws BuildException(Code)(Java Doc)
public String getEncoding()(Code)(Java Doc)
protected FileUtils getFileUtils()(Code)(Java Doc)
protected Vector getFilterChains()(Code)(Java Doc)
protected Vector getFilterSets()(Code)(Java Doc)
public String getOutputEncoding()(Code)(Java Doc)
public boolean getPreserveLastModified()(Code)(Java Doc)
public boolean isEnableMultipleMapping()(Code)(Java Doc)
protected void scan(File fromDir, File toDir, String[] files, String[] dirs)(Code)(Java Doc)
protected Map scan(Resource[] fromResources, File toDir)(Code)(Java Doc)
public void setEnableMultipleMappings(boolean enableMultipleMappings)(Code)(Java Doc)
public void setEncoding(String encoding)(Code)(Java Doc)
public void setFailOnError(boolean failonerror)(Code)(Java Doc)
public void setFile(File file)(Code)(Java Doc)
public void setFiltering(boolean filtering)(Code)(Java Doc)
public void setFlatten(boolean flatten)(Code)(Java Doc)
public void setGranularity(long granularity)(Code)(Java Doc)
public void setIncludeEmptyDirs(boolean includeEmpty)(Code)(Java Doc)
public void setOutputEncoding(String encoding)(Code)(Java Doc)
public void setOverwrite(boolean overwrite)(Code)(Java Doc)
public void setPreserveLastModified(String preserve)(Code)(Java Doc)
public void setPreserveLastModified(boolean preserve)(Code)(Java Doc)
public void setTodir(File destDir)(Code)(Java Doc)
public void setTofile(File destFile)(Code)(Java Doc)
public void setVerbose(boolean verbose)(Code)(Java Doc)
protected boolean supportsNonFileResources()(Code)(Java Doc)
protected void validateAttributes() throws BuildException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.