Source Code Cross Referenced for SolutionRepositoryVfsFileContent.java in  » Report » pentaho-report » org » pentaho » repository » filebased » solution » 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 » Report » pentaho report » org.pentaho.repository.filebased.solution 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2007 Pentaho Corporation.  All rights reserved.
003:         * This software was developed by Pentaho Corporation and is provided under the terms 
004:         * of the Mozilla Public License, Version 1.1, or any later version. You may not use 
005:         * this file except in compliance with the license. If you need a copy of the license, 
006:         * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho 
007:         * BI Platform.  The Initial Developer is Pentaho Corporation.
008:         *
009:         * Software distributed under the Mozilla Public License is distributed on an "AS IS" 
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or  implied. Please refer to 
011:         * the license for the specific language governing your rights and limitations.
012:         */
013:        package org.pentaho.repository.filebased.solution;
014:
015:        import java.io.FileNotFoundException;
016:        import java.io.InputStream;
017:        import java.io.OutputStream;
018:        import java.security.cert.Certificate;
019:        import java.util.Map;
020:
021:        import org.apache.commons.vfs.FileContent;
022:        import org.apache.commons.vfs.FileContentInfo;
023:        import org.apache.commons.vfs.FileObject;
024:        import org.apache.commons.vfs.FileSystemException;
025:        import org.apache.commons.vfs.RandomAccessContent;
026:        import org.apache.commons.vfs.util.RandomAccessMode;
027:
028:        public class SolutionRepositoryVfsFileContent implements  FileContent {
029:
030:            private SolutionRepositoryVfsFileObject fileObject;
031:
032:            private InputStream inputStream = null;
033:
034:            private boolean isOpen = false;
035:
036:            public SolutionRepositoryVfsFileContent(
037:                    SolutionRepositoryVfsFileObject fileObject) {
038:                super ();
039:                this .fileObject = fileObject;
040:            }
041:
042:            public FileObject getFile() {
043:                return fileObject;
044:            }
045:
046:            public long getSize() throws FileSystemException {
047:                // not needed for our usage
048:                return 0;
049:            }
050:
051:            public long getLastModifiedTime() throws FileSystemException {
052:                // not needed for our usage
053:                return 0;
054:            }
055:
056:            public void setLastModifiedTime(long arg0)
057:                    throws FileSystemException {
058:                // not needed for our usage
059:
060:            }
061:
062:            public Map getAttributes() throws FileSystemException {
063:                // not needed for our usage
064:                return null;
065:            }
066:
067:            public String[] getAttributeNames() throws FileSystemException {
068:                // not needed for our usage
069:                return null;
070:            }
071:
072:            public Object getAttribute(String arg0) throws FileSystemException {
073:                // not needed for our usage
074:                return null;
075:            }
076:
077:            public void setAttribute(String arg0, Object arg1)
078:                    throws FileSystemException {
079:                // not needed for our usage
080:
081:            }
082:
083:            public Certificate[] getCertificates() throws FileSystemException {
084:                // not needed for our usage
085:                return null;
086:            }
087:
088:            public InputStream getInputStream() throws FileSystemException {
089:
090:                try {
091:                    inputStream = fileObject.getRepository()
092:                            .getResourceInputStream(fileObject.getFileRef(),
093:                                    true);
094:                } catch (FileNotFoundException e) {
095:                    throw new FileSystemException(e.getLocalizedMessage(), e);
096:                }
097:                isOpen = true;
098:                return inputStream;
099:            }
100:
101:            public OutputStream getOutputStream() throws FileSystemException {
102:                // not needed for our usage
103:                return null;
104:            }
105:
106:            public RandomAccessContent getRandomAccessContent(
107:                    RandomAccessMode arg0) throws FileSystemException {
108:                // not needed for our usage
109:                return null;
110:            }
111:
112:            public OutputStream getOutputStream(boolean arg0)
113:                    throws FileSystemException {
114:                // not needed for our usage
115:                return null;
116:            }
117:
118:            public void close() throws FileSystemException {
119:
120:                if (!isOpen) {
121:                    return;
122:                }
123:                if (inputStream != null) {
124:                    try {
125:                        inputStream.close();
126:                    } catch (Exception e) {
127:                        // not much we can do here
128:                    }
129:                }
130:                isOpen = false;
131:                fileObject.close();
132:            }
133:
134:            public FileContentInfo getContentInfo() throws FileSystemException {
135:                // not needed for our usage
136:                return null;
137:            }
138:
139:            public boolean isOpen() {
140:                // not needed for our usage
141:                return isOpen;
142:            }
143:
144:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.