Java Doc for FileTool.java in  » Profiler » JMeasurement » de » mcs » utils » 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 » Profiler » JMeasurement » de.mcs.utils 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   de.mcs.utils.FileTool

FileTool
final public class FileTool (Code)
filetool class.
author:
   w.klaas

Inner Class :static class FileIncludes implements FilenameFilter



Method Summary
public static  StringconvertBackSlashes(String path)
     converts one slash into 2 backslashes.
public static  StringconvertBackSlashesNoParams(String aPath)
     converts only if backslash is not proceeded by a blank.
public static  StringconvertSlashes(String path)
     converts 2 backslashes into one slash.
public static  booleancopy(String source, String destination)
     Copy source location to destination.
public static  booleancopy(String source, String destination, boolean subdirectories)
     Copy source location to destination.
public static  booleancreateDirectories(String directory)
     Create a directory; all non-existent ancestor directories are.
public static  booleancreateDirectory(String directory)
     Create a directory; all ancestor directories must exist.
public static  booleancreateDirectoryStructure(String aDirectory, String[] subdirectories)
     Create a directory and a number of subdirectories specified in the String array automatically created.
public static  StringeliminateDoubleSlashes(String filename)
     Eleminates // in a filename.
public static  booleanfileExists(String fileName)
     Retrieves the existance of a file or directory (to be or not to be....).
Parameters:
  fileName - name of the file or directory.
protected static  booleanfilecopy(String source, String destination, boolean subdirectories)
     Copy source location to destination.
public static  FilegetAbsoluteFile(String filename)
    
Parameters:
  filename - A filename that may be a relative filename like "." or "..".
public static  StringmakeDirectory(String aPath)
     making a string to a directory with ending on File.separator.
public static  booleanmove(String source, String destination)
     Move / Rename source location to destination.
public static  StringnormPath(String aPath)
     converting the given path with an File.separator at the end.
public static  ArrayListreadFileToArrayList(String fileName)
     reading a file into an arraylist.
public static  StringreadFileToString(String fileName)
     reading a file into an arraylist.
public static  booleanremove(String filename, boolean bRecursive)
     removes a directory recursively.
public static  booleanremove(String filename, boolean bRecursive, ArrayList excludes)
     removes a directory recursively.
public static  booleanremove(String filename)
     Delete the file.
public static  voidwriteStringToFile(String filename, String content)
     simple writing a string into a file.



Method Detail
convertBackSlashes
public static String convertBackSlashes(String path)(Code)
converts one slash into 2 backslashes.
Parameters:
  path - to convert string



convertBackSlashesNoParams
public static String convertBackSlashesNoParams(String aPath)(Code)
converts only if backslash is not proceeded by a blank.
Parameters:
  aPath - to convert string



convertSlashes
public static String convertSlashes(String path)(Code)
converts 2 backslashes into one slash.
Parameters:
  path - to convert string



copy
public static boolean copy(String source, String destination)(Code)
Copy source location to destination.
Parameters:
  source - source
Parameters:
  destination - destination success



copy
public static boolean copy(String source, String destination, boolean subdirectories)(Code)
Copy source location to destination.
Parameters:
  source - source
Parameters:
  destination - destination
Parameters:
  subdirectories - subdirectories success



createDirectories
public static boolean createDirectories(String directory)(Code)
Create a directory; all non-existent ancestor directories are. automatically created
Parameters:
  directory - the directory success



createDirectory
public static boolean createDirectory(String directory)(Code)
Create a directory; all ancestor directories must exist.
Parameters:
  directory - name of the directory success



createDirectoryStructure
public static boolean createDirectoryStructure(String aDirectory, String[] subdirectories)(Code)
Create a directory and a number of subdirectories specified in the String array automatically created.
Parameters:
  aDirectory - the directory
Parameters:
  subdirectories - the subdirectories success



eliminateDoubleSlashes
public static String eliminateDoubleSlashes(String filename)(Code)
Eleminates // in a filename.
Parameters:
  filename - to convert String



fileExists
public static boolean fileExists(String fileName)(Code)
Retrieves the existance of a file or directory (to be or not to be....).
Parameters:
  fileName - name of the file or directory. success



filecopy
protected static boolean filecopy(String source, String destination, boolean subdirectories)(Code)
Copy source location to destination.
Parameters:
  source - The pathname of a single directory or a single file ormultiple files through a filemask.
Parameters:
  destination - destination path
Parameters:
  subdirectories - allow subdirectories to be copied true if this operation succseeded



getAbsoluteFile
public static File getAbsoluteFile(String filename)(Code)

Parameters:
  filename - A filename that may be a relative filename like "." or "..". The absolute File name instance fo the given(relative) filename. Return null if ".." is givenand the current or parent directory is /



makeDirectory
public static String makeDirectory(String aPath)(Code)
making a string to a directory with ending on File.separator.
Parameters:
  aPath - path to convert string



move
public static boolean move(String source, String destination)(Code)
Move / Rename source location to destination. String array automatically created
Parameters:
  source - source
Parameters:
  destination - destination success



normPath
public static String normPath(String aPath)(Code)
converting the given path with an File.separator at the end.
Parameters:
  aPath - the path to convert the converted path



readFileToArrayList
public static ArrayList readFileToArrayList(String fileName)(Code)
reading a file into an arraylist. Every line is one entry.
Parameters:
  fileName - file to read ArrayList with all lines



readFileToString
public static String readFileToString(String fileName)(Code)
reading a file into an arraylist. Every line is one entry.
Parameters:
  fileName - file to read ArrayList with all lines



remove
public static boolean remove(String filename, boolean bRecursive) throws IOException(Code)
removes a directory recursively. All Files and Subdirectories are removed. If bRecursive is false and the directory is not empty, an IOException is thrown.
Parameters:
  filename - path or file to remove
Parameters:
  bRecursive - delete all subfolders too success true if all files could be removed, elsereturn false
throws:
  IOException - if something goes wrong



remove
public static boolean remove(String filename, boolean bRecursive, ArrayList excludes) throws IOException(Code)
removes a directory recursively. All Files and Subdirectories are removed. If bRecursive is false and the directory is not empty, an IOException is thrown.
Parameters:
  filename - path or file to remove
Parameters:
  bRecursive - delete all subfolders too
Parameters:
  excludes - list with files to exclude from deleting success true if all files could be removed, elsereturn false
throws:
  IOException - if something goes wrong



remove
public static boolean remove(String filename)(Code)
Delete the file.
Parameters:
  filename - file to delete true if the file could be delete,false if not.



writeStringToFile
public static void writeStringToFile(String filename, String content)(Code)
simple writing a string into a file.
Parameters:
  filename - of the file to create
Parameters:
  content - string to write into the file.



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.