Source Code Cross Referenced for Media.java in  » Ajax » zk » org » zkoss » util » media » 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 » Ajax » zk » org.zkoss.util.media 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Media.java
002:
003:        {{IS_NOTE
004:        	Purpose:
005:        		
006:        	Description:
007:        		
008:        	History:
009:        		Wed Feb 26 13:29:14     2003, Created by tomyeh
010:        }}IS_NOTE
011:
012:        Copyright (C) 2002 Potix Corporation. All Rights Reserved.
013:
014:        {{IS_RIGHT
015:        	This program is distributed under GPL Version 2.0 in the hope that
016:        	it will be useful, but WITHOUT ANY WARRANTY.
017:        }}IS_RIGHT
018:         */
019:        package org.zkoss.util.media;
020:
021:        import java.io.Reader;
022:        import java.io.InputStream;
023:
024:        /**
025:         * Represents any multi-medai, such as a voice, a pdf file, an excel file,
026:         * an image and so on.
027:         *
028:         * <p>By implementing this interface, objects can be processed generically
029:         * by servlets and many other codes.
030:         *
031:         * @author tomyeh
032:         */
033:        public interface Media {
034:            /** Returns whether the format of tis content is binary or text-based.
035:             * If true, use {@link #getByteData} or {@link #getStreamData}, depending on
036:             * {@link #inMemory}, to retrieve its content.
037:             * If false, use {@link #getStringData} or {@link #getReaderData}, depending on
038:             * {@link #inMemory}, to retrieve its content.
039:             *
040:             * <p>To decide which API to use, you need to examine
041:             * both {@link #isBinary} and {@link #inMemory}.
042:             *
043:             * @see #getStringData
044:             * @see #getByteData
045:             * @see #getReaderData
046:             * @see #getStreamData
047:             */
048:            public boolean isBinary();
049:
050:            /** Returns whether the data is cached in memory (in form of
051:             * byte[] or String).
052:             * If true, use {@link #getByteData} or {@link #getStringData}, depending on
053:             * {@link #isBinary}, to retrieve its content.
054:             * If false, use {@link #getStreamData} or {@link #getReaderData}, depending on
055:             * {@link #isBinary}, to retrieve its content.
056:             *
057:             * <p>To decide which API to use, you need to examine
058:             * both {@link #isBinary} and {@link #inMemory}.
059:             *
060:             * @see #getStringData
061:             * @see #getByteData
062:             * @see #getReaderData
063:             * @see #getStreamData
064:             */
065:            public boolean inMemory();
066:
067:            /** Returns the raw data in byte array.
068:             *
069:             * <p>It might <i>not</i> be a copy, so don't modify
070:             * it directly unless you know what you are doing.
071:             *
072:             * @exception IllegalStateException if {@link #isBinary} returns false,
073:             * or {@link #inMemory} returns false.
074:             * @see #getStringData
075:             */
076:            public byte[] getByteData();
077:
078:            /** Returns the raw data in string.
079:             *
080:             * @exception IllegalStateException if {@link #isBinary} returns false,
081:             * or {@link #inMemory} returns false.
082:             * @see #getByteData
083:             */
084:            public String getStringData();
085:
086:            /** Returns the raw data in InputStream.
087:             *
088:             * <p>Note: it wraps {@link #getByteData} with ByteArrayInputStream
089:             * if it is in memory ({@link #inMemory} returns true.
090:             *
091:             * @exception IllegalStateException if {@link #isBinary} returns false.
092:             * @see #getReaderData
093:             */
094:            public InputStream getStreamData();
095:
096:            /** Returns the raw data in Reader.
097:             *
098:             * <p>Note: it wraps {@link #getStringData} with StringReader,
099:             * if it is in memory ({@link #inMemory} returns true.
100:             *
101:             * @exception IllegalStateException if {@link #isBinary} returns true.
102:             * @see #getStreamData
103:             */
104:            public Reader getReaderData();
105:
106:            /** Returns the name (usually filename) of this media, or null
107:             * if not available.
108:             */
109:            public String getName();
110:
111:            /** Returns the format name, e.g., "jpeg", or null if not available.
112:             * @see #getContentType
113:             */
114:            public String getFormat();
115:
116:            /** Returns the content type, e.g., "image/jpeg", or null if not available.
117:             * @see #getFormat
118:             */
119:            public String getContentType();
120:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.