Java Doc for DirectoryUtils.java in  » UML » MetaBoss » com » metaboss » util » 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 » UML » MetaBoss » com.metaboss.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.metaboss.util.DirectoryUtils

DirectoryUtils
public class DirectoryUtils (Code)
Set of useful utilites




Method Summary
public static  booleancanCreate(File pPathToCreate)
     Returns true if specified path can be created.
public static  booleancanDelete(File pPathToDelete)
     Returns true if specified path can be deleted.
Parameters:
  pPathToDelete - file or directory to test true if path is not present or can be removed.
public static  voidcopyDirectory(String pFromDirectoryPath, String pToDirectoryPath)
     Copies contents of the from directory (excluding directory itself) to the destination directory (again excluding directory itself).
public static  FilecreateTempDir(String pPrefix, String pSuffix)
     This utility method is almost the same as File.createTempFile() method, with the only difference is that it creates directory and not a file.
public static  voiddeleteAllDirectoryContents(File pDirectory)
    
public static  voiddeleteAllFilesInTheDirectory(File pDirectory)
     Deletes all files in the specified directory.
public static  voiddeleteDirectory(File pDirectory)
    
public static  voiddeleteDirectoryIfExists(File pDirectory)
     Deletes all contents of the specified directory including directory itself.
public static  voidensureNewCleanDirectory(String pDirectoryPath)
    
public static  voidensureNewNoFilesDirectory(String pDirectoryPath)
     Makes sure that the directory without files exists and accessible. Cleans up contents of the existing directory if necessary.
public static  voidensureThereIsDirectory(String pDirectoryPath)
    
public static  StringgetUniqueTempDirectoryAbsolutePath()
    
public static  String[]listAllChildDirectoriesInDirectory(String pDirectoryAbsolutePath)
    
public static  String[]listAllDescendantDirectoriesInDirectory(String pDirectoryAbsolutePath)
    
public static  String[]listAllDirectoriesWithName(String pRootDirectoryAbsolutePath, String pNameToLookFor)
     Lists all directories contained in the directory and all subdirectories which have its last name equal to the given one.
public static  String[]listAllFilesInDirectory(String pDirectoryAbsolutePath, FileFilter pFilter)
     Lists all files contained in the directory and possibly subdirectories, which are satisfying given file filter.
public static  String[]listAllFilesInDirectory(String pDirectoryAbsolutePath)
    
public static  voidtrimDirectoryTree(String pTreeRootDirectoryPath)
     Trims tree of directories excluding specified directory.



Method Detail
canCreate
public static boolean canCreate(File pPathToCreate)(Code)
Returns true if specified path can be created.
Parameters:
  pPathToCreate - file or directory to test true if path is not present and can be created



canDelete
public static boolean canDelete(File pPathToDelete)(Code)
Returns true if specified path can be deleted.
Parameters:
  pPathToDelete - file or directory to test true if path is not present or can be removed. For directorybeing able to remove means that all it's contents are writeable including subdirectories



copyDirectory
public static void copyDirectory(String pFromDirectoryPath, String pToDirectoryPath) throws FileNotFoundException, IOException(Code)
Copies contents of the from directory (excluding directory itself) to the destination directory (again excluding directory itself). Same files get overwritten



createTempDir
public static File createTempDir(String pPrefix, String pSuffix) throws IOException(Code)
This utility method is almost the same as File.createTempFile() method, with the only difference is that it creates directory and not a file.



deleteAllDirectoryContents
public static void deleteAllDirectoryContents(File pDirectory) throws IOException(Code)
Deletes all contents of the specified directory including subdirectories, but excluding the directory itself



deleteAllFilesInTheDirectory
public static void deleteAllFilesInTheDirectory(File pDirectory) throws IOException(Code)
Deletes all files in the specified directory. This excludes any subdirectories



deleteDirectory
public static void deleteDirectory(File pDirectory) throws IOException(Code)
Deletes all contents of the specified directory including directory itself



deleteDirectoryIfExists
public static void deleteDirectoryIfExists(File pDirectory) throws IOException(Code)
Deletes all contents of the specified directory including directory itself. Does not fail if directory does not exist - just exist gracefully



ensureNewCleanDirectory
public static void ensureNewCleanDirectory(String pDirectoryPath) throws IOException(Code)
Makes sure that the clean directory exists and accessible cleans up contents of the existing directory if necessary



ensureNewNoFilesDirectory
public static void ensureNewNoFilesDirectory(String pDirectoryPath) throws IOException(Code)
Makes sure that the directory without files exists and accessible. Cleans up contents of the existing directory if necessary. This version does not touch any subdirectories. Use ensureNewCleanDirectory() if you wish to ensure that totally clean director exists.



ensureThereIsDirectory
public static void ensureThereIsDirectory(String pDirectoryPath)(Code)
Makes sure that the directory exists and accessible creates directory if necesary



getUniqueTempDirectoryAbsolutePath
public static String getUniqueTempDirectoryAbsolutePath()(Code)
Generates the ful path for the unique temporary directory



listAllChildDirectoriesInDirectory
public static String[] listAllChildDirectoriesInDirectory(String pDirectoryAbsolutePath) throws FileNotFoundException(Code)
Lists all direct child directories contained in the directory array of strings with each element being an absolute path to the child directory of the specified directory



listAllDescendantDirectoriesInDirectory
public static String[] listAllDescendantDirectoriesInDirectory(String pDirectoryAbsolutePath) throws FileNotFoundException(Code)
Lists all descendant directories (on any level) contained in the directory array of strings with each element being an absolute path to the descendant directory of the specified directory



listAllDirectoriesWithName
public static String[] listAllDirectoriesWithName(String pRootDirectoryAbsolutePath, String pNameToLookFor) throws FileNotFoundException(Code)
Lists all directories contained in the directory and all subdirectories which have its last name equal to the given one. List is in no particular order. Search will stop at the first match and not go any deeper. So if there is a directory ......\name\.....\name only to level directory will be returned
Parameters:
  pRootDirectoryAbsolutePath - the absolute path to the directory to start search from
Parameters:
  pNameToLookFor - the name to match array of strings with each element being an absolute path to the directory matching the criteria



listAllFilesInDirectory
public static String[] listAllFilesInDirectory(String pDirectoryAbsolutePath, FileFilter pFilter) throws FileNotFoundException(Code)
Lists all files contained in the directory and possibly subdirectories, which are satisfying given file filter. Note that subdirectories will onbly be considered if file filter accepts them array of strings with each element being an absolute path to the file contained in the directory



listAllFilesInDirectory
public static String[] listAllFilesInDirectory(String pDirectoryAbsolutePath) throws FileNotFoundException(Code)
Lists all files contained in the directory and all subdirectories in no particular order array of strings with each element being an absolute path to the file contained in the directory



trimDirectoryTree
public static void trimDirectoryTree(String pTreeRootDirectoryPath) throws FileNotFoundException, IOException(Code)
Trims tree of directories excluding specified directory. Trimming means deleting the directories without any contents.



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.