Java Doc for IoUtil.java in  » Development » Java-Plugin-Framework » org » java » plugin » 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 » Development » Java Plugin Framework » org.java.plugin.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.java.plugin.util.IoUtil

IoUtil
final public class IoUtil (Code)
Input/Output, File and URL/URI related utilities.
version:
   $Id: IoUtil.java,v 1.9 2007/04/17 17:39:52 ddimon Exp $




Method Summary
public static  booleancompareFileDates(Date date1, Date date2)
     For some reason modification milliseconds for some files are unstable, use this function to compare file dates ignoring milliseconds.
public static  booleancompareFiles(File file1, File file2)
     Compares two files for directories/files synchronization purposes.
public static  voidcopyFile(File src, File dest)
     Copies one file, existing file will be overridden.
public static  voidcopyFolder(File src, File dest)
    
public static  voidcopyFolder(File src, File dest, boolean recursive)
    
public static  voidcopyFolder(File src, File dest, boolean recursive, boolean onlyNew)
     Copies folder.
public static  voidcopyFolder(File src, File dest, boolean recursive, boolean onlyNew, FileFilter filter)
     Copies folder.
public static  voidcopyStream(InputStream in, OutputStream out, int bufferSize)
     Copies streams.
public static  booleanemptyFolder(File folder)
     Recursively deletes whole content of the given folder.
public static  URLfile2url(File file)
     Utility method to convert a File object to a local URL.
public static  InputStreamgetResourceInputStream(URL url)
     Opens input stream for given resource.
public static  booleanisResourceExists(URL url)
     Checks if resource exist and can be opened.
public static  voidsynchronizeFolders(File src, File dest)
     Performs one-way directories synchronization comparing files only, not folders.
public static  voidsynchronizeFolders(File src, File dest, FileFilter filter)
     Performs one-way directories synchronization comparing files only, not folders.
public static  Fileurl2file(URL url)
     Utility method to convert local URL to a File object.



Method Detail
compareFileDates
public static boolean compareFileDates(Date date1, Date date2)(Code)
For some reason modification milliseconds for some files are unstable, use this function to compare file dates ignoring milliseconds.
Parameters:
  date1 - first file modification date
Parameters:
  date2 - second file modification date true if files modification dates are equal ignoringmilliseconds



compareFiles
public static boolean compareFiles(File file1, File file2)(Code)
Compares two files for directories/files synchronization purposes.
Parameters:
  file1 - one file to compare
Parameters:
  file2 - another file to compare true if file names are equal (case sensitive), fileshave equal lengths and modification dates (milliseconds ignored)
See Also:   IoUtil.synchronizeFolders(File,File)
See Also:   IoUtil.compareFileDates(Date,Date)



copyFile
public static void copyFile(File src, File dest) throws IOException(Code)
Copies one file, existing file will be overridden.
Parameters:
  src - source file to copy FROM
Parameters:
  dest - destination file to copy TO
throws:
  IOException - if any I/O error has occurred



copyFolder
public static void copyFolder(File src, File dest) throws IOException(Code)
Copies folder recursively, existing files will be overridden
Parameters:
  src - source folder
Parameters:
  dest - target folder
throws:
  IOException - if any I/O error has occurred



copyFolder
public static void copyFolder(File src, File dest, boolean recursive) throws IOException(Code)
Copies folder, existing files will be overridden
Parameters:
  src - source folder
Parameters:
  dest - target folder
Parameters:
  recursive - if true, processes folder recursively
throws:
  IOException - if any I/O error has occurred



copyFolder
public static void copyFolder(File src, File dest, boolean recursive, boolean onlyNew) throws IOException(Code)
Copies folder.
Parameters:
  src - source folder
Parameters:
  dest - target folder
Parameters:
  recursive - if true, processes folder recursively
Parameters:
  onlyNew - if true, target file will be overridden if itis older than source file only
throws:
  IOException - if any I/O error has occurred



copyFolder
public static void copyFolder(File src, File dest, boolean recursive, boolean onlyNew, FileFilter filter) throws IOException(Code)
Copies folder.
Parameters:
  src - source folder
Parameters:
  dest - target folder
Parameters:
  recursive - if true, processes folder recursively
Parameters:
  onlyNew - if true, target file will be overridden if itis older than source file only
Parameters:
  filter - file filter, optional, if null all files willbe copied
throws:
  IOException - if any I/O error has occurred



copyStream
public static void copyStream(InputStream in, OutputStream out, int bufferSize) throws IOException(Code)
Copies streams.
Parameters:
  in - source stream
Parameters:
  out - destination stream
Parameters:
  bufferSize - buffer size to use
throws:
  IOException - if any I/O error has occurred



emptyFolder
public static boolean emptyFolder(File folder)(Code)
Recursively deletes whole content of the given folder.
Parameters:
  folder - folder to be emptied true if given folder becomes empty or not exists



file2url
public static URL file2url(File file) throws MalformedURLException(Code)
Utility method to convert a File object to a local URL.
Parameters:
  file - a file object absolute URL that points to the given file
throws:
  MalformedURLException - if file can't be represented as URL forsome reason



getResourceInputStream
public static InputStream getResourceInputStream(URL url) throws IOException(Code)
Opens input stream for given resource. This method behaves differently for different URL types:
  • for local files it returns buffered file input stream;
  • for local JAR files it reads resource content into memory buffer and returns byte array input stream that wraps those buffer (this prevents locking JAR file);
  • for common URL's this method simply opens stream to that URL using standard URL API.
It is not recommended to use this method for big resources within JAR files.
Parameters:
  url - resource URL input stream for given resource
throws:
  IOException - if any I/O error has occurred



isResourceExists
public static boolean isResourceExists(URL url)(Code)
Checks if resource exist and can be opened.
Parameters:
  url - absolute URL which points to a resource to be checked true if given URL points to an existing resource



synchronizeFolders
public static void synchronizeFolders(File src, File dest) throws IOException(Code)
Performs one-way directories synchronization comparing files only, not folders.
Parameters:
  src - source folder
Parameters:
  dest - target folder
throws:
  IOException - if any I/O error has occurred
See Also:   IoUtil.synchronizeFolders(File,File,FileFilter)
See Also:   IoUtil.compareFiles(File,File)



synchronizeFolders
public static void synchronizeFolders(File src, File dest, FileFilter filter) throws IOException(Code)
Performs one-way directories synchronization comparing files only, not folders.
Parameters:
  src - source folder
Parameters:
  dest - target folder
Parameters:
  filter - file filter, optional, if null all files willbe included into synchronization process
throws:
  IOException - if any I/O error has occurred
See Also:   IoUtil.compareFiles(File,File)



url2file
public static File url2file(URL url)(Code)
Utility method to convert local URL to a File object.
Parameters:
  url - an URL file object for given URL or null if URL is notlocal



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.