Java Doc for ServeTextFile.java in  » J2EE » Expresso » com » jcorporate » expresso » ext » controller » 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 » J2EE » Expresso » com.jcorporate.expresso.ext.controller 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.jcorporate.expresso.core.controller.DBController
   com.jcorporate.expresso.ext.controller.ServeTextFile

ServeTextFile
public class ServeTextFile extends DBController (Code)
This controller is used to serve up text files. It helps provide a particularly useful mechanism for tutorial purposes.

PLEASE NOTE!: It is DEFINITELY not recommended that this controller should be opened up to anybody but the Administrator in a production environment! It could be used by malicious attackers to cause the system to cough up password files, and many other things that they would not normally have access to


author:
   Michael Rimov - Adapted from code created by Peter Pilgrim.

Inner Class :class Parameters
Inner Class :static class ReservedWord

Field Summary
final public static  StringDEFAULT_CPLUS_COMMENT_COLOR
    
final public static  StringDEFAULT_CSTYLE_COMMENT_COLOR
    
final public static  StringDEFAULT_DECIMAL_NUMBER_COLOR
    
final public static  StringDEFAULT_DOUBLE_QUOTE_COLOR
    
final public static  StringDEFAULT_PRIMITIVE_VAR_COLOR
    
final public static  StringDEFAULT_RESERVED_KEYWORD_COLOR
    
final public static  StringDEFAULT_SINGLE_QUOTE_COLOR
    
final public static  StringDEFAULT_SPECIAL_KEYWORD_COLOR
    
final protected static  StringcplusCommentColor
    
final protected static  StringcstyleCommentColor
    
final protected static  StringdecimalNumberColor
    
final protected static  StringdoubleQuoteColor
    
protected static  Hashtablefast_keyword_map
    
final protected static  ServeTextFile.ReservedWord[]java_reserved_keywords
    
final protected static  StringprimitiveVarColor
    
final protected static  StringreservedKeywordColor
    
final protected static  StringsingleQuoteColor
    
final protected static  StringspecialKeywordColor
    

Constructor Summary
public  ServeTextFile()
    

Method Summary
public  StringgetTitle()
    
protected  voidreturnFile(String filename, OutputStream out)
    
public  voidreturnHTMLFormattedFile(Parameters params)
    
protected  ControllerResponserunServeJavaFileState(ControllerRequest request, ControllerResponse response)
     Serves up a java source file as specified by the parameter.
protected  ControllerResponserunServeTextFileState(ControllerRequest request, ControllerResponse response)
     Serves up a basic text file as specified by the parameter.
final protected static  StringsubstituteEntity(char c9)
    
protected  voidwriteContent(Parameters params)
    
protected  voidwriteFooter(Parameters params)
    
public  voidwriteHeader(Parameters params)
    

Field Detail
DEFAULT_CPLUS_COMMENT_COLOR
final public static String DEFAULT_CPLUS_COMMENT_COLOR(Code)



DEFAULT_CSTYLE_COMMENT_COLOR
final public static String DEFAULT_CSTYLE_COMMENT_COLOR(Code)



DEFAULT_DECIMAL_NUMBER_COLOR
final public static String DEFAULT_DECIMAL_NUMBER_COLOR(Code)



DEFAULT_DOUBLE_QUOTE_COLOR
final public static String DEFAULT_DOUBLE_QUOTE_COLOR(Code)



DEFAULT_PRIMITIVE_VAR_COLOR
final public static String DEFAULT_PRIMITIVE_VAR_COLOR(Code)



DEFAULT_RESERVED_KEYWORD_COLOR
final public static String DEFAULT_RESERVED_KEYWORD_COLOR(Code)



DEFAULT_SINGLE_QUOTE_COLOR
final public static String DEFAULT_SINGLE_QUOTE_COLOR(Code)



DEFAULT_SPECIAL_KEYWORD_COLOR
final public static String DEFAULT_SPECIAL_KEYWORD_COLOR(Code)



cplusCommentColor
final protected static String cplusCommentColor(Code)



cstyleCommentColor
final protected static String cstyleCommentColor(Code)



decimalNumberColor
final protected static String decimalNumberColor(Code)



doubleQuoteColor
final protected static String doubleQuoteColor(Code)



fast_keyword_map
protected static Hashtable fast_keyword_map(Code)



java_reserved_keywords
final protected static ServeTextFile.ReservedWord[] java_reserved_keywords(Code)



primitiveVarColor
final protected static String primitiveVarColor(Code)



reservedKeywordColor
final protected static String reservedKeywordColor(Code)



singleQuoteColor
final protected static String singleQuoteColor(Code)



specialKeywordColor
final protected static String specialKeywordColor(Code)




Constructor Detail
ServeTextFile
public ServeTextFile()(Code)




Method Detail
getTitle
public String getTitle()(Code)



returnFile
protected void returnFile(String filename, OutputStream out) throws FileNotFoundException, IOException(Code)



returnHTMLFormattedFile
public void returnHTMLFormattedFile(Parameters params) throws FileNotFoundException, IOException(Code)



runServeJavaFileState
protected ControllerResponse runServeJavaFileState(ControllerRequest request, ControllerResponse response) throws ControllerException(Code)
Serves up a java source file as specified by the parameter. This state is different from that of servTextFile in that it color codes all the keywords, etc in the java file.

Our goal here is to provide something that is reasonably secure in that we remove all URL trickery, and we also only serve up NON source code files. Again, this should be NOT used in a production environment and only exists for teaching purposes.
Parameters:
  request - The ControllerRequest Object
Parameters:
  response - The ControllerResponse Object ControllerResponse
throws:
  ControllerException - upon error




runServeTextFileState
protected ControllerResponse runServeTextFileState(ControllerRequest request, ControllerResponse response) throws ControllerException(Code)
Serves up a basic text file as specified by the parameter. Our goal here is to provide something that is reasonably secure in that we remove all URL trickery.
Parameters:
  request - The ControllerRequest Object
Parameters:
  response - The ControllerResponse Object ControllerResponse
throws:
  ControllerException - upon error



substituteEntity
final protected static String substituteEntity(char c9)(Code)



writeContent
protected void writeContent(Parameters params) throws FileNotFoundException, IOException(Code)



writeFooter
protected void writeFooter(Parameters params) throws FileNotFoundException, IOException(Code)



writeHeader
public void writeHeader(Parameters params) throws FileNotFoundException, IOException(Code)



Methods inherited from com.jcorporate.expresso.core.controller.DBController
protected String getString(String stringCode, Object[] args, ControllerRequest myRequest)(Code)(Java Doc)
public static boolean isAllowed(ControllerRequest request, DBController controller, String newState) throws DBException, CacheException(Code)(Java Doc)
public boolean stateAllowed(String newState, ControllerRequest myRequest) throws ControllerException(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.