Java Doc for IoHelper.java in  » Installer » IzPack » com » izforge » izpack » 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 » Installer » IzPack » com.izforge.izpack.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.izforge.izpack.util.IoHelper

IoHelper
public class IoHelper (Code)

Class with some IO related helper.





Method Summary
public static  voidchmod(File file, String permissions)
     Changes the permissions of the given file to the given POSIX permissions.
public static  voidchmod(String path, String permissions)
     Changes the permissions of the given file to the given POSIX permissions.
public static  voidcopyFile(String inFile, String outFile)
     Copies the contents of inFile into outFile.
public static  voidcopyFile(File inFile, File outFile)
     Creates an in- and output stream for the given File objects and copies all the data from the specified input to the specified output.
public static  voidcopyFile(File inFile, File outFile, String permissions)
     Creates an in- and output stream for the given File objects and copies all the data from the specified input to the specified output.
public static  voidcopyFile(File inFile, File outFile, VariableSubstitutor vss)
     Creates an in- and output stream for the given File objects and copies all the data from the specified input to the specified output.
public static  voidcopyFile(File inFile, File outFile, String permissions, VariableSubstitutor vs)
     Creates an in- and output stream for the given File objects and copies all the data from the specified input to the specified output.
public static  voidcopyFile(File inFile, File outFile, String permissions, VariableSubstitutor vs, String type)
     Creates an in- and output stream for the given File objects and copies all the data from the specified input to the specified output.
public static  FilecopyToTempFile(File template, String defaultExtension)
     Creates a temp file with delete on exit rule.
public static  FilecopyToTempFile(File template, String defaultExtension, VariableSubstitutor vss)
     Creates a temp file with delete on exit rule.
public static  FilecopyToTempFile(String template, String defaultExtension)
     Creates a temp file with delete on exit rule.
public static  FileexistingParent(File path)
    
public static  longgetFreeSpace(String path)
     Returns the free (disk) space for the given path.
public static  StringgetPrimaryGroup()
     Returns the primary group of the current user.
public static  Stringgetenv(String key)
     Returns the value of the environment variable given by key.
public static  StringreplaceString(String destination, String what, String with)
     Returns a string resulting from replacing all occurrences of what in this string with with. In opposite to the String.replaceAll method this method do not use regular expression or other methods which are only available in JRE 1.4 and later.
public static  booleansupported(String method)
     Returns whether the given method will be supported with the given environment.
public static  StringtranslatePath(String destination, VariableSubstitutor vs)
     Translates a relative path to a local system path.
Parameters:
  destination - The path to translate.



Method Detail
chmod
public static void chmod(File file, String permissions) throws IOException(Code)
Changes the permissions of the given file to the given POSIX permissions.
Parameters:
  file - the file for which the permissions should be changed
Parameters:
  permissions - POSIX permissions to be set
throws:
  IOException - if an I/O error occurs



chmod
public static void chmod(String path, String permissions) throws IOException(Code)
Changes the permissions of the given file to the given POSIX permissions. This method will be raised an exception, if the OS is not UNIX.
Parameters:
  path - the absolute path of the file for which the permissions should be changed
Parameters:
  permissions - POSIX permissions to be set
throws:
  IOException - if an I/O error occurs



copyFile
public static void copyFile(String inFile, String outFile) throws IOException(Code)
Copies the contents of inFile into outFile.
Parameters:
  inFile - path of file which should be copied
Parameters:
  outFile - path of file to create and copy the contents of inFile into



copyFile
public static void copyFile(File inFile, File outFile) throws IOException(Code)
Creates an in- and output stream for the given File objects and copies all the data from the specified input to the specified output.
Parameters:
  inFile - File object for input
Parameters:
  outFile - File object for output
exception:
  IOException - if an I/O error occurs



copyFile
public static void copyFile(File inFile, File outFile, String permissions) throws IOException(Code)
Creates an in- and output stream for the given File objects and copies all the data from the specified input to the specified output. If permissions is not null, a chmod will be done on the output file.
Parameters:
  inFile - File object for input
Parameters:
  outFile - File object for output
Parameters:
  permissions - permissions for the output file
exception:
  IOException - if an I/O error occurs



copyFile
public static void copyFile(File inFile, File outFile, VariableSubstitutor vss) throws IOException(Code)
Creates an in- and output stream for the given File objects and copies all the data from the specified input to the specified output. If the VariableSubstitutor is not null, a substition will be done during copy.
Parameters:
  inFile - File object for input
Parameters:
  outFile - File object for output
Parameters:
  vss - substitutor which is used during copying
exception:
  IOException - if an I/O error occurs



copyFile
public static void copyFile(File inFile, File outFile, String permissions, VariableSubstitutor vs) throws IOException(Code)
Creates an in- and output stream for the given File objects and copies all the data from the specified input to the specified output. If the VariableSubstitutor is not null, a substition will be done during copy. If permissions is not null, a chmod will be done on the output file.
Parameters:
  inFile - File object for input
Parameters:
  outFile - File object for output
Parameters:
  permissions - permissions for the output file
Parameters:
  vs - substitutor which is used during copying
exception:
  IOException - if an I/O error occurs



copyFile
public static void copyFile(File inFile, File outFile, String permissions, VariableSubstitutor vs, String type) throws IOException(Code)
Creates an in- and output stream for the given File objects and copies all the data from the specified input to the specified output. If the VariableSubstitutor is not null, a substition will be done during copy. If permissions is not null, a chmod will be done on the output file. If type is not null, that type is used as file type at substitution.
Parameters:
  inFile - File object for input
Parameters:
  outFile - File object for output
Parameters:
  permissions - permissions for the output file
Parameters:
  vs - substitutor which is used during copying
Parameters:
  type - file type for the substitutor
exception:
  IOException - if an I/O error occurs



copyToTempFile
public static File copyToTempFile(File template, String defaultExtension) throws IOException(Code)
Creates a temp file with delete on exit rule. The extension is extracted from the template if possible, else the default extension is used. The contents of template will be copied into the temporary file.
Parameters:
  template - file to copy from and define file extension
Parameters:
  defaultExtension - file extension if no is contained in template newly created and filled temporary file
throws:
  IOException -



copyToTempFile
public static File copyToTempFile(File template, String defaultExtension, VariableSubstitutor vss) throws IOException(Code)
Creates a temp file with delete on exit rule. The extension is extracted from the template if possible, else the default extension is used. The contents of template will be copied into the temporary file. If the variable substitutor is not null, variables will be replaced during copying.
Parameters:
  template - file to copy from and define file extension
Parameters:
  defaultExtension - file extension if no is contained in template
Parameters:
  vss - substitutor which is used during copying newly created and filled temporary file
throws:
  IOException -



copyToTempFile
public static File copyToTempFile(String template, String defaultExtension) throws IOException(Code)
Creates a temp file with delete on exit rule. The extension is extracted from the template if possible, else the default extension is used. The contents of template will be copied into the temporary file.
Parameters:
  template - file to copy from and define file extension
Parameters:
  defaultExtension - file extension if no is contained in template newly created and filled temporary file
throws:
  IOException -



existingParent
public static File existingParent(File path)(Code)
Returns the first existing parent directory in a path
Parameters:
  path - path which should be scanned the first existing parent directory in a path



getFreeSpace
public static long getFreeSpace(String path)(Code)
Returns the free (disk) space for the given path. If it is not ascertainable -1 returns.
Parameters:
  path - path for which the free space should be detected the free space for the given path



getPrimaryGroup
public static String getPrimaryGroup()(Code)
Returns the primary group of the current user. This feature will be supported only on Unix. On other systems null returns. the primary group of the current user



getenv
public static String getenv(String key)(Code)
Returns the value of the environment variable given by key. This method is a work around for VM versions which do not support getenv in an other way. At the first call all environment variables will be loaded via an exec. On Windows keys are not case sensitive.
Parameters:
  key - variable name for which the value should be resolved the value of the environment variable given by key



replaceString
public static String replaceString(String destination, String what, String with)(Code)
Returns a string resulting from replacing all occurrences of what in this string with with. In opposite to the String.replaceAll method this method do not use regular expression or other methods which are only available in JRE 1.4 and later. This method was special made to mask masked slashes to avert a conversion during path translation.
Parameters:
  destination - string for which the replacing should be performed
Parameters:
  what - what string should be replaced
Parameters:
  with - with what string what should be replaced a new String object if what was found in the given string, else the given string self



supported
public static boolean supported(String method)(Code)
Returns whether the given method will be supported with the given environment. Some methods of this class are not supported on all operation systems.
Parameters:
  method - name of the method true if the method will be supported with the current enivronment else false
throws:
  RuntimeException - if the given method name does not exist



translatePath
public static String translatePath(String destination, VariableSubstitutor vs)(Code)
Translates a relative path to a local system path.
Parameters:
  destination - The path to translate. The translated path.



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.