Java Doc for CmsFile.java in  » Content-Management-System » opencms » org » opencms » file » 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 » opencms » org.opencms.file 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.opencms.file.CmsResource
      org.opencms.file.CmsFile

All known Subclasses:   org.opencms.file.history.CmsHistoryFile,
CmsFile
public class CmsFile extends CmsResource implements Cloneable,Serializable,Comparable(Code)
A file resource in the OpenCms VFS.

A file resource is a CmsResource that contains an additional byte array of binary data, which is the file content.

A file object is not allowed to have sub-resources.


author:
   Alexander Kandzior
author:
   Michael Emmerich
version:
   $Revision: 1.30 $
since:
   6.0.0




Constructor Summary
public  CmsFile(CmsResource resource)
    
public  CmsFile(CmsUUID structureId, CmsUUID resourceId, String path, int type, int flags, CmsUUID projectId, CmsResourceState state, long dateCreated, CmsUUID userCreated, long dateLastModified, CmsUUID userLastModified, long dateReleased, long dateExpired, int linkCount, int length, long dateContent, int version, byte[] content)
    

Method Summary
public  Objectclone()
    
public  byte[]getContents()
    
public  intgetLength()
    
public  booleanisFile()
    
public  booleanisFolder()
    
public  voidsetContents(byte[] value)
    
public static  CmsFileupgrade(CmsResource resource, CmsObject cms)
     Utility method to upgrade a CmsResource to a CmsFile.

Sometimes a CmsResource might already be a (casted) CmsFile that also has the contents read.



Constructor Detail
CmsFile
public CmsFile(CmsResource resource)(Code)
Constructor, creates a new file Object from the given resource with an empty byte array as file content, if the resource does not implement a file.


Parameters:
  resource - the base resource object to create a file from




CmsFile
public CmsFile(CmsUUID structureId, CmsUUID resourceId, String path, int type, int flags, CmsUUID projectId, CmsResourceState state, long dateCreated, CmsUUID userCreated, long dateLastModified, CmsUUID userLastModified, long dateReleased, long dateExpired, int linkCount, int length, long dateContent, int version, byte[] content)(Code)
Constructor, creates a new file object.


Parameters:
  structureId - the id of this resources structure record
Parameters:
  resourceId - the id of this resources resource record
Parameters:
  path - the filename of this resource
Parameters:
  type - the type of this resource
Parameters:
  flags - the flags of this resource
Parameters:
  projectId - the project id this resource was last modified in
Parameters:
  state - the state of this resource
Parameters:
  dateCreated - the creation date of this resource
Parameters:
  userCreated - the id of the user who created this resource
Parameters:
  dateLastModified - the date of the last modification of this resource
Parameters:
  userLastModified - the id of the user who did the last modification of this resource
Parameters:
  dateReleased - the release date of this resource
Parameters:
  dateExpired - the expiration date of this resource
Parameters:
  linkCount - the count of all siblings of this resource
Parameters:
  length - the size of the file content of this resource
Parameters:
  dateContent - the date of the last modification of the content of this resource
Parameters:
  version - the version number of this resource
Parameters:
  content - the binary content data of this file





Method Detail
clone
public Object clone()(Code)
Returns a clone of this Objects instance.

a clone of this instance




getContents
public byte[] getContents()(Code)
Returns the content of this file.

the content of this file




getLength
public int getLength()(Code)

See Also:   org.opencms.file.CmsResource.getLength



isFile
public boolean isFile()(Code)

See Also:   org.opencms.file.CmsResource.isFile



isFolder
public boolean isFolder()(Code)

See Also:   org.opencms.file.CmsResource.isFolder



setContents
public void setContents(byte[] value)(Code)
Sets the contents of this file.

This will also set the date content, but only if the content is already set.


Parameters:
  value - the content of this file




upgrade
public static CmsFile upgrade(CmsResource resource, CmsObject cms) throws CmsException(Code)
Utility method to upgrade a CmsResource to a CmsFile.

Sometimes a CmsResource might already be a (casted) CmsFile that also has the contents read. This method tries to optimize read access to the VFS by "upgrading" the CmsResource to a CmsFile first. If this fails, the CmsFile is read from the VFS.


Parameters:
  resource - the resource to upgrade
Parameters:
  cms - permission context for accessing the VFS the upgraded (or read) file
throws:
  CmsException - if something goes wrongCmsObject.readFile(CmsResource)




Fields inherited from org.opencms.file.CmsResource
final public static Comparator COMPARE_DATE_RELEASED(Code)(Java Doc)
final public static Comparator COMPARE_ROOT_PATH(Code)(Java Doc)
final public static Comparator COMPARE_ROOT_PATH_IGNORE_CASE(Code)(Java Doc)
final public static Comparator COMPARE_ROOT_PATH_IGNORE_CASE_FOLDERS_FIRST(Code)(Java Doc)
final public static CmsResourceCopyMode COPY_AS_NEW(Code)(Java Doc)
final public static CmsResourceCopyMode COPY_AS_SIBLING(Code)(Java Doc)
final public static CmsResourceCopyMode COPY_PRESERVE_SIBLING(Code)(Java Doc)
final public static long DATE_EXPIRED_DEFAULT(Code)(Java Doc)
final public static long DATE_RELEASED_DEFAULT(Code)(Java Doc)
final public static long DATE_RELEASED_EXPIRED_IGNORE(Code)(Java Doc)
final public static CmsResourceDeleteMode DELETE_PRESERVE_SIBLINGS(Code)(Java Doc)
final public static CmsResourceDeleteMode DELETE_REMOVE_SIBLINGS(Code)(Java Doc)
final public static int FLAG_INTERNAL(Code)(Java Doc)
final public static int FLAG_LABELED(Code)(Java Doc)
final public static int FLAG_TEMPFILE(Code)(Java Doc)
final public static String NAME_CONSTRAINTS(Code)(Java Doc)
final public static CmsResourceState STATE_CHANGED(Code)(Java Doc)
final public static CmsResourceState STATE_DELETED(Code)(Java Doc)
final public static CmsResourceState STATE_KEEP(Code)(Java Doc)
final public static CmsResourceState STATE_NEW(Code)(Java Doc)
final public static CmsResourceState STATE_UNCHANGED(Code)(Java Doc)
final public static long TOUCH_DATE_UNCHANGED(Code)(Java Doc)
final public static CmsResourceUndoMode UNDO_CONTENT(Code)(Java Doc)
final public static CmsResourceUndoMode UNDO_CONTENT_RECURSIVE(Code)(Java Doc)
final public static CmsResourceUndoMode UNDO_MOVE_CONTENT(Code)(Java Doc)
final public static CmsResourceUndoMode UNDO_MOVE_CONTENT_RECURSIVE(Code)(Java Doc)
final public static String VFS_FOLDER_SITES(Code)(Java Doc)
final public static String VFS_FOLDER_SYSTEM(Code)(Java Doc)
protected long m_dateContent(Code)(Java Doc)
protected int m_length(Code)(Java Doc)

Methods inherited from org.opencms.file.CmsResource
public static void checkResourceName(String name) throws CmsIllegalArgumentException(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
public int compareTo(Object obj)(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
public long getDateContent()(Code)(Java Doc)
public long getDateCreated()(Code)(Java Doc)
public long getDateExpired()(Code)(Java Doc)
public long getDateLastModified()(Code)(Java Doc)
public long getDateReleased()(Code)(Java Doc)
public int getFlags()(Code)(Java Doc)
public static String getFolderPath(String resource)(Code)(Java Doc)
public int getLength()(Code)(Java Doc)
public static String getName(String resource)(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public static String getParentFolder(String resource)(Code)(Java Doc)
public static int getPathLevel(String resource)(Code)(Java Doc)
public static String getPathPart(String resource, int level)(Code)(Java Doc)
public CmsUUID getProjectLastModified()(Code)(Java Doc)
public CmsUUID getResourceId()(Code)(Java Doc)
public String getRootPath()(Code)(Java Doc)
public int getSiblingCount()(Code)(Java Doc)
public CmsResourceState getState()(Code)(Java Doc)
public CmsUUID getStructureId()(Code)(Java Doc)
public int getTypeId()(Code)(Java Doc)
public CmsUUID getUserCreated()(Code)(Java Doc)
public CmsUUID getUserLastModified()(Code)(Java Doc)
public int getVersion()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isExpired(long time)(Code)(Java Doc)
public boolean isFile()(Code)(Java Doc)
public static boolean isFolder(String resource)(Code)(Java Doc)
public boolean isFolder()(Code)(Java Doc)
public boolean isInternal()(Code)(Java Doc)
public boolean isLabeled()(Code)(Java Doc)
public boolean isReleased(long time)(Code)(Java Doc)
public boolean isReleasedAndNotExpired(long time)(Code)(Java Doc)
public boolean isTouched()(Code)(Java Doc)
public void setDateExpired(long time)(Code)(Java Doc)
public void setDateLastModified(long time)(Code)(Java Doc)
public void setDateReleased(long time)(Code)(Java Doc)
public void setFlags(int flags)(Code)(Java Doc)
public void setState(CmsResourceState state)(Code)(Java Doc)
public void setType(int type)(Code)(Java Doc)
public void setUserLastModified(CmsUUID resourceLastModifiedByUserId)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

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.