Java Doc for DirectoryUtil.java in  » IDE-Netbeans » iep.editor » org » netbeans » modules » iep » project » anttasks » 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 » IDE Netbeans » iep.editor » org.netbeans.modules.iep.project.anttasks 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.modules.iep.project.anttasks.DirectoryUtil

DirectoryUtil
public class DirectoryUtil extends Object (Code)

author:
   Bing Lu



Constructor Summary
public  DirectoryUtil()
    

Method Summary
public static  StringbuildFullPath(String aDir, String aFileName)
     this util method construct the absolute path from its parts.
public static  booleancopyFile(File source, File dest)
     Copy one file's contents to another file.
Parameters:
  source - The file to copy.
Parameters:
  dest - The file to copy to.
public static  booleancopyFile(String source, String destDir)
    
public static  voidcopyFilesInDir(File sourceDir, File targetDir, FileFilter filter, boolean recursive)
    
public static  voidcopyStream(InputStream is, OutputStream os)
    
public static  voidcopyStream(Reader r, Writer w)
    
public static  voidcopyTree(File sourceDir, File targetDir, String[] excludeExt)
     This method copies recursively copies all the files in a directory to another directory, maintaining the source directory's child directory structure.
public static  booleancreateDir(String dirName)
     This method will create a directory and its parent directories.
public static  booleandeleteDir(String dirName)
     This method will recursively delete a directory and all its files and subdirectories.
public static  booleandeleteDir(File dir)
     This method will recursively delete a directory and all its files and subdirectories.
public static  booleandeleteDir(File dir, boolean deleteOriginalDir)
     This method will recursively delete a directory and all its files and subdirectories.
Parameters:
  dir - The directory to delete
Parameters:
  deleteOriginalDir - Whether or not to delete the original directory.
public static  booleandeleteFile(String filename)
     This method will delete a single file.
Parameters:
  filename - Full pathname of the file to delete.
public static  booleandeleteFile(String filename, String dirName)
     This method will delete a single file.
Parameters:
  filename - Name of the file.
Parameters:
  dirName - Directory where the file can be found.
public static  booleandirExists(String dirName)
     This method will check if a file exists.
Parameters:
  dirName - Full pathname of the directory.
public static  booleanfileExists(String filename)
     This method will check if a file exists.
Parameters:
  filename - Full pathname of the file.
public static  ListgetFiles(String fromDir)
     This method will return an arraylist containing all the file/s name/s in the provided directory name
Parameters:
  fromDir - Current directory where files are located.
public static  ListgetFilesRecursively(File dir, FileFilter filter)
    
public static  ListgetFilesRecursively(File dir, String[] extensions)
    
public static  booleanmoveFile(String filename, String toDir)
     This method will move a single file from one directory to another.
Parameters:
  filename - Full path name of the file.
Parameters:
  toDir - Directory where to move file to.
public static  booleanmoveFile(File file, String toDir)
     This method will move a single file from one directory to another.
public static  booleanmoveFile(String filename, String fromDir, String toDir)
     This method will more a single file from one directory to another.
Parameters:
  filename - Name of the file.
Parameters:
  fromDir - Current directory where file is located.
Parameters:
  toDir - Directory where to move file to.
public static  voidmoveFilesInDir(File sourceDir, File targetDir, FileFilter filter, boolean recursive)
    
public static  voidmoveTree(File sourceDir, File targetDir, String[] excludeExt)
    


Constructor Detail
DirectoryUtil
public DirectoryUtil()(Code)
Creates new DirectoryUtil




Method Detail
buildFullPath
public static String buildFullPath(String aDir, String aFileName)(Code)
this util method construct the absolute path from its parts. it will remove any preamble to the file name prior to concatenate the path elements.
Parameters:
  aDir - - the directory part of the absolute path
Parameters:
  aFileName - - the file part of the absolute path string absolute path of the parameters provided.



copyFile
public static boolean copyFile(File source, File dest)(Code)
Copy one file's contents to another file.
Parameters:
  source - The file to copy.
Parameters:
  dest - The file to copy to. true if the copy succeeded, false otherwise.



copyFile
public static boolean copyFile(String source, String destDir)(Code)

Parameters:
  source - source directory to copy
Parameters:
  destDir - target directory where it will be copied to whether copy was successfule or not



copyFilesInDir
public static void copyFilesInDir(File sourceDir, File targetDir, FileFilter filter, boolean recursive)(Code)

Parameters:
  sourceDir - source directory
Parameters:
  targetDir - target directory
Parameters:
  filter - file filter
Parameters:
  recursive - TODO: document me!



copyStream
public static void copyStream(InputStream is, OutputStream os) throws IOException(Code)

Parameters:
  is - input stream
Parameters:
  os - output stream
exception:
  IOException - rethrow exception from streams



copyStream
public static void copyStream(Reader r, Writer w) throws IOException(Code)

Parameters:
  r - reader object
Parameters:
  w - writer object
exception:
  IOException - rethrow exception from streams



copyTree
public static void copyTree(File sourceDir, File targetDir, String[] excludeExt)(Code)
This method copies recursively copies all the files in a directory to another directory, maintaining the source directory's child directory structure. If any particular file type should be excluded, it's extension may be specified using the excludeExt argument.
Parameters:
  sourceDir - The directory to copy files from.
Parameters:
  targetDir - The directory to copy files to.
Parameters:
  excludeExt - Array of string extensions of form .ext to exclude fromthe copy.



createDir
public static boolean createDir(String dirName)(Code)
This method will create a directory and its parent directories. The specified directory cannot be created if a file exists with the same name.
Parameters:
  dirName - Full pathname of directory to be created. boolean Returns true if directory already exists or was createdsucessfully, false otherwise.



deleteDir
public static boolean deleteDir(String dirName)(Code)
This method will recursively delete a directory and all its files and subdirectories.
Parameters:
  dirName - The full path of the directory to delete Returns true if directory was deleted, false otherwise.



deleteDir
public static boolean deleteDir(File dir)(Code)
This method will recursively delete a directory and all its files and subdirectories.
Parameters:
  dir - The directory to delete Returns true if directory was deleted, false otherwise.



deleteDir
public static boolean deleteDir(File dir, boolean deleteOriginalDir)(Code)
This method will recursively delete a directory and all its files and subdirectories.
Parameters:
  dir - The directory to delete
Parameters:
  deleteOriginalDir - Whether or not to delete the original directory. Returns true if directory was deleted, false otherwise.



deleteFile
public static boolean deleteFile(String filename)(Code)
This method will delete a single file.
Parameters:
  filename - Full pathname of the file to delete. boolean Returns true if file was deleted, false otherwise.



deleteFile
public static boolean deleteFile(String filename, String dirName)(Code)
This method will delete a single file.
Parameters:
  filename - Name of the file.
Parameters:
  dirName - Directory where the file can be found. boolean Returns true if file was deleted, false otherwise.



dirExists
public static boolean dirExists(String dirName)(Code)
This method will check if a file exists.
Parameters:
  dirName - Full pathname of the directory. boolean Returns true if the directory exists, false otherwise



fileExists
public static boolean fileExists(String filename)(Code)
This method will check if a file exists.
Parameters:
  filename - Full pathname of the file. boolean Returns true if the file exists and is not a directory,false otherwise



getFiles
public static List getFiles(String fromDir)(Code)
This method will return an arraylist containing all the file/s name/s in the provided directory name
Parameters:
  fromDir - Current directory where files are located. ArrayList - could be zero in length if directory is empty or nofound.



getFilesRecursively
public static List getFilesRecursively(File dir, FileFilter filter)(Code)



getFilesRecursively
public static List getFilesRecursively(File dir, String[] extensions)(Code)



moveFile
public static boolean moveFile(String filename, String toDir)(Code)
This method will move a single file from one directory to another.
Parameters:
  filename - Full path name of the file.
Parameters:
  toDir - Directory where to move file to. boolean Returns true if file was moved successfully, falseotherwise.



moveFile
public static boolean moveFile(File file, String toDir)(Code)
This method will move a single file from one directory to another.
Parameters:
  toDir - Directory where to move file to.
Parameters:
  file - file that will be moved boolean Returns true if file was moved successfully, falseotherwise.



moveFile
public static boolean moveFile(String filename, String fromDir, String toDir)(Code)
This method will more a single file from one directory to another.
Parameters:
  filename - Name of the file.
Parameters:
  fromDir - Current directory where file is located.
Parameters:
  toDir - Directory where to move file to. boolean Returns true if file was moved successfully, falseotherwise.



moveFilesInDir
public static void moveFilesInDir(File sourceDir, File targetDir, FileFilter filter, boolean recursive)(Code)

Parameters:
  sourceDir - source directory
Parameters:
  targetDir - target directory
Parameters:
  filter - file filter
Parameters:
  recursive - TODO: document me!



moveTree
public static void moveTree(File sourceDir, File targetDir, String[] excludeExt)(Code)

Parameters:
  sourceDir - source dir to be moved
Parameters:
  targetDir - target : where it will be moved to
Parameters:
  excludeExt - exclude files with these extension for the move



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.