Java Doc for FileUtils.java in  » Web-Crawler » heritrix » org » archive » 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 » Web Crawler » heritrix » org.archive.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.archive.util.FileUtils

FileUtils
public class FileUtils (Code)
Utility methods for manipulating files and directories.
author:
   John Erik Halse


Field Summary
final public static  FileTMPDIR
    


Method Summary
public static  booleancopyFile(File src, File dest)
     Copy the src file to the destination.
public static  booleancopyFile(File src, File dest, boolean overwrite)
     Copy the src file to the destination.
Parameters:
  src -
Parameters:
  dest -
Parameters:
  overwrite - If target file already exits, and this parameter istrue, overwrite target file (We do this by first deleting the targetfile before we begin the copy).
public static  booleancopyFile(File src, File dest, long extent)
    
public static  booleancopyFile(File src, File dest, long extent, boolean overwrite)
     Copy up to extent bytes of the source file to the destination
Parameters:
  src -
Parameters:
  dest -
Parameters:
  extent - Maximum number of bytes to copy
Parameters:
  overwrite - If target file already exits, and this parameter istrue, overwrite target file (We do this by first deleting the targetfile before we begin the copy).
public static  intcopyFiles(File srcDir, Set srcFile, File dest)
    
public static  voidcopyFiles(File src, File dest)
     Recursively copy all files from one directory to another.
public static  voidcopyFiles(File src, FilenameFilter filter, File dest, boolean inSortedOrder, boolean overwrite)
     Recursively copy all files from one directory to another.
Parameters:
  src - File or directory to copy from.
Parameters:
  filter - Filename filter to apply to src.
public static  booleandeleteDir(File dir)
     Deletes all files and subdirectories under dir.
Parameters:
  dir - true if all deletions were successful.
public static  File[]getFilesWithPrefix(File dir, String prefix)
     Get a list of all files in directory that have passed prefix.
Parameters:
  dir - Dir to look in.
Parameters:
  prefix - Basename of files to look for.
public static  FileFiltergetRegexpFileFilter(String regexp)
     Get a @link java.io.FileFilter that filters files based on a regular expression.
Parameters:
  regexp - the regular expression the files must match.
public static  String[]getSortedDirContent(File src, FilenameFilter filter)
    
Parameters:
  src - Directory of files to fetch.
Parameters:
  filter - Filter to apply to filenames.
public static  FileisReadable(File f)
     Test file exists and is readable.
public static  booleanisReadableWithExtensionAndMagic(File f, String uncompressedExtension, String magic)
    
Parameters:
  f - File to test.
public static  FilemaybeRelative(File context, String path)
     Turn path into a File, relative to context (which may be ignored if path is absolute).
public static  StringreadFileAsString(File file)
     Utility method to read an entire file as a String.
public static  voidsyncDirectories(File src, FilenameFilter filter, File tgt)
     Use for case where files are being added to src.
protected static  voidworkaroundCopyFile(File src, File dest)
    

Field Detail
TMPDIR
final public static File TMPDIR(Code)





Method Detail
copyFile
public static boolean copyFile(File src, File dest) throws FileNotFoundException, IOException(Code)
Copy the src file to the destination.
Parameters:
  src -
Parameters:
  dest - True if the extent was greater than actual bytes copied.
throws:
  FileNotFoundException -
throws:
  IOException -



copyFile
public static boolean copyFile(File src, File dest, boolean overwrite) throws FileNotFoundException, IOException(Code)
Copy the src file to the destination.
Parameters:
  src -
Parameters:
  dest -
Parameters:
  overwrite - If target file already exits, and this parameter istrue, overwrite target file (We do this by first deleting the targetfile before we begin the copy). True if the extent was greater than actual bytes copied.
throws:
  FileNotFoundException -
throws:
  IOException -



copyFile
public static boolean copyFile(File src, File dest, long extent) throws FileNotFoundException, IOException(Code)
Copy up to extent bytes of the source file to the destination
Parameters:
  src -
Parameters:
  dest -
Parameters:
  extent - Maximum number of bytes to copy True if the extent was greater than actual bytes copied.
throws:
  FileNotFoundException -
throws:
  IOException -



copyFile
public static boolean copyFile(File src, File dest, long extent, boolean overwrite) throws FileNotFoundException, IOException(Code)
Copy up to extent bytes of the source file to the destination
Parameters:
  src -
Parameters:
  dest -
Parameters:
  extent - Maximum number of bytes to copy
Parameters:
  overwrite - If target file already exits, and this parameter istrue, overwrite target file (We do this by first deleting the targetfile before we begin the copy). True if the extent was greater than actual bytes copied.
throws:
  FileNotFoundException -
throws:
  IOException -



copyFiles
public static int copyFiles(File srcDir, Set srcFile, File dest) throws IOException(Code)



copyFiles
public static void copyFiles(File src, File dest) throws IOException(Code)
Recursively copy all files from one directory to another.
Parameters:
  src - file or directory to copy from.
Parameters:
  dest - file or directory to copy to.
throws:
  IOException -



copyFiles
public static void copyFiles(File src, FilenameFilter filter, File dest, boolean inSortedOrder, boolean overwrite) throws IOException(Code)
Recursively copy all files from one directory to another.
Parameters:
  src - File or directory to copy from.
Parameters:
  filter - Filename filter to apply to src. May be null if nofiltering wanted.
Parameters:
  dest - File or directory to copy to.
Parameters:
  inSortedOrder - Copy in order of natural sort.
Parameters:
  overwrite - If target file already exits, and this parameter istrue, overwrite target file (We do this by first deleting the targetfile before we begin the copy).
throws:
  IOException -



deleteDir
public static boolean deleteDir(File dir)(Code)
Deletes all files and subdirectories under dir.
Parameters:
  dir - true if all deletions were successful. If a deletion fails, themethod stops attempting to delete and returns false.



getFilesWithPrefix
public static File[] getFilesWithPrefix(File dir, String prefix)(Code)
Get a list of all files in directory that have passed prefix.
Parameters:
  dir - Dir to look in.
Parameters:
  prefix - Basename of files to look for. Compare is case insensitive. List of files in dir that start w/ passed basename.



getRegexpFileFilter
public static FileFilter getRegexpFileFilter(String regexp)(Code)
Get a @link java.io.FileFilter that filters files based on a regular expression.
Parameters:
  regexp - the regular expression the files must match. the newly created filter.



getSortedDirContent
public static String[] getSortedDirContent(File src, FilenameFilter filter)(Code)

Parameters:
  src - Directory of files to fetch.
Parameters:
  filter - Filter to apply to filenames. Files in directory sorted.



isReadable
public static File isReadable(File f) throws IOException(Code)
Test file exists and is readable.
Parameters:
  f - File to test.
exception:
  IOException - If file does not exist or is not unreadable.



isReadableWithExtensionAndMagic
public static boolean isReadableWithExtensionAndMagic(File f, String uncompressedExtension, String magic) throws IOException(Code)

Parameters:
  f - File to test. True if file is readable, has uncompressed extension,and magic string at file start.
exception:
  IOException - If file does not exist or is not readable.



maybeRelative
public static File maybeRelative(File context, String path)(Code)
Turn path into a File, relative to context (which may be ignored if path is absolute).
Parameters:
  context - File context if path is relative
Parameters:
  path - String path to make into a File File created



readFileAsString
public static String readFileAsString(File file) throws IOException(Code)
Utility method to read an entire file as a String.
Parameters:
  file - File as String.
throws:
  IOException -



syncDirectories
public static void syncDirectories(File src, FilenameFilter filter, File tgt) throws IOException(Code)
Use for case where files are being added to src. Will break off copy when tgt is same as src.
Parameters:
  src - Source directory to copy from.
Parameters:
  tgt - Target to copy to.
Parameters:
  filter - Filter to apply to files to copy.
throws:
  IOException -



workaroundCopyFile
protected static void workaroundCopyFile(File src, File dest) throws IOException(Code)



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.