Java Doc for ResUtils.java in  » Content-Management-System » TransferCM » com » methodhead » res » 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 » Content Management System » TransferCM » com.methodhead.res 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.methodhead.res.ResUtils

ResUtils
public class ResUtils (Code)
A collection of utility methods used in the com.methodhead.res package.




Method Summary
public static  StringcleanPath(String path)
     Replaces any consecutive file separators with a single file separator.
public static  voidcopyFile(File from, File to)
     Copies from to to; if from is a directory, it is recursively copied.
public static  voiddeleteFile(File file)
     Deletes file; if file is a directory, it is recursively deleted.
public static  FilegetFile(HttpServlet servlet, String path, String fileName)
     Returns a file by combining path and fileName and using it as a path relative to the webapp.
public static  FileManagergetFileManager(ResPolicy policy, HttpServletRequest request)
     NOT UNIT TESTED Returns the file manager in the request, creating and initializing one if necessary.
public static  FileTreegetFileTree(ResPolicy policy, HttpServletRequest request)
     Returns the file tree from the session, creating and initializing it if necessary.
public static  ResPolicygetPolicy(ActionMapping mapping)
     NOT UNIT TESTED Instantiates the ResPolicy for defined in mapping's parameter.
public static  booleanisPathDescendent(String parentPath, String path)
     Returns true if path is contained by parentPath at some level.
public static  booleanisSafeFileName(String name)
     Returns true if name has an unsafe file extension (.jsp to .do).
public static  booleanisValidFileName(String name)
     Returns true if name doesn't contain any invalid characters (\, /).
public static  booleanisValidPath(String path)
     Returns true if path doesn't contain any invalid characters sequences (..).
public static  String[]nodesToFileNames(List nodes)
     NOT UNIT TESTED Converts a list of FoldingTreeNodes (as created in ResForm.reset ResForm.reset() ) to an array of filenames.
public static  StringtrimPath(String path)
     Trims any leading or trailing spaces and separator characters from path.



Method Detail
cleanPath
public static String cleanPath(String path)(Code)
Replaces any consecutive file separators with a single file separator.



copyFile
public static void copyFile(File from, File to) throws ResException, IOException(Code)
Copies from to to; if from is a directory, it is recursively copied. If to is exists and is not a directory, it is overwritten. If to is exists and is a directory, the contents of from are copied over the contents of to. If to exists, but is a directory when from is not (or vice versa), an exception is thrown. NOT UNIT TESTED



deleteFile
public static void deleteFile(File file)(Code)
Deletes file; if file is a directory, it is recursively deleted.



getFile
public static File getFile(HttpServlet servlet, String path, String fileName)(Code)
Returns a file by combining path and fileName and using it as a path relative to the webapp.



getFileManager
public static FileManager getFileManager(ResPolicy policy, HttpServletRequest request)(Code)
NOT UNIT TESTED Returns the file manager in the request, creating and initializing one if necessary.



getFileTree
public static FileTree getFileTree(ResPolicy policy, HttpServletRequest request)(Code)
Returns the file tree from the session, creating and initializing it if necessary.



getPolicy
public static ResPolicy getPolicy(ActionMapping mapping)(Code)
NOT UNIT TESTED Instantiates the ResPolicy for defined in mapping's parameter.



isPathDescendent
public static boolean isPathDescendent(String parentPath, String path)(Code)
Returns true if path is contained by parentPath at some level. If path equals parentPath this method will also return true. This method is strictly a string operation; no files are actually accessed. The path separator is always assumed to be a forward slash (/). Any leading or trailing spaces and separator characters are trimmed from both paths before any tests are performed.



isSafeFileName
public static boolean isSafeFileName(String name)(Code)
Returns true if name has an unsafe file extension (.jsp to .do).



isValidFileName
public static boolean isValidFileName(String name)(Code)
Returns true if name doesn't contain any invalid characters (\, /).



isValidPath
public static boolean isValidPath(String path)(Code)
Returns true if path doesn't contain any invalid characters sequences (..).



nodesToFileNames
public static String[] nodesToFileNames(List nodes)(Code)
NOT UNIT TESTED Converts a list of FoldingTreeNodes (as created in ResForm.reset ResForm.reset() ) to an array of filenames.



trimPath
public static String trimPath(String path)(Code)
Trims any leading or trailing spaces and separator characters from 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.