Java Doc for FileContent.java in  » Library » Apache-commons-vfs-20070724-src » org » apache » commons » vfs » 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 » Library » Apache commons vfs 20070724 src » org.apache.commons.vfs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.vfs.FileContent

All known Subclasses:   org.apache.commons.vfs.provider.DefaultFileContent,
FileContent
public interface FileContent (Code)
Represents the data content of a file.

To read from a file, use the InputStream returned by FileContent.getInputStream .

To write to a file, use the OutputStream returned by FileContent.getOutputStream method. This will create the file, and the parent folder, if necessary.

A file may have multiple InputStreams open at the sametime.


author:
   Adam Murdoch
version:
   $Revision: 537943 $ $Date: 2007-05-14 11:37:14 -0700 (Mon, 14 May 2007) $
See Also:   FileObject.getContent





Method Summary
 voidclose()
     Closes all resources used by the content, including any open stream. Commits pending changes to the file.

This method is a hint to the implementation that it can release resources.

 ObjectgetAttribute(String attrName)
     Gets the value of an attribute of the file's content.
Parameters:
  attrName - The name of the attribute.
 String[]getAttributeNames()
     Lists the attributes of the file's content. The names of the attributes.
 MapgetAttributes()
     Returns a read-only map of this file's attributes.
 Certificate[]getCertificates()
     Retrieves the certificates if any used to sign this file or folder.
public  FileContentInfogetContentInfo()
     get the content info.
 FileObjectgetFile()
     Returns the file which this is the content of.
 InputStreamgetInputStream()
     Returns an input stream for reading the file's content.

There may only be a single input or output stream open for the file at any time. An input stream to read the file's content from.

 longgetLastModifiedTime()
     Determines the last-modified timestamp of the file.
 OutputStreamgetOutputStream()
     Returns an output stream for writing the file's content.

If the file does not exist, this method creates it, and the parent folder, if necessary.

 OutputStreamgetOutputStream(boolean bAppend)
     Returns an output stream for writing the file's content.

If the file does not exist, this method creates it, and the parent folder, if necessary.

public  RandomAccessContentgetRandomAccessContent(RandomAccessMode mode)
     Returns an stream for reading/writing the file's content.
 longgetSize()
     Determines the size of the file, in bytes.
 booleanhasAttribute(String attrName)
     Checks if an attribute of the file's content exists.
public  booleanisOpen()
    
 voidremoveAttribute(String attrName)
     Removes the value of an attribute of the file's content.
 voidsetAttribute(String attrName, Object value)
     Sets the value of an attribute of the file's content.
 voidsetLastModifiedTime(long modTime)
     Sets the last-modified timestamp of the file.



Method Detail
close
void close() throws FileSystemException(Code)
Closes all resources used by the content, including any open stream. Commits pending changes to the file.

This method is a hint to the implementation that it can release resources. This object can continue to be used after calling this method.




getAttribute
Object getAttribute(String attrName) throws FileSystemException(Code)
Gets the value of an attribute of the file's content.
Parameters:
  attrName - The name of the attribute. Attribute names are case insensitive. The value of the attribute, or null if the attribute value isunknown.
throws:
  FileSystemException - If the file does not exist, or does not support attributes.



getAttributeNames
String[] getAttributeNames() throws FileSystemException(Code)
Lists the attributes of the file's content. The names of the attributes. Never returns null;
throws:
  FileSystemException - If the file does not exist, or does not support attributes.



getAttributes
Map getAttributes() throws FileSystemException(Code)
Returns a read-only map of this file's attributes.
throws:
  FileSystemException - If the file does not exist, or does not support attributes.



getCertificates
Certificate[] getCertificates() throws FileSystemException(Code)
Retrieves the certificates if any used to sign this file or folder. The certificates, or an empty array if there are no certificates orthe file does not support signing.
throws:
  FileSystemException - If the file does not exist, or is being written.



getContentInfo
public FileContentInfo getContentInfo() throws FileSystemException(Code)
get the content info. e.g. type, encoding, ...



getFile
FileObject getFile()(Code)
Returns the file which this is the content of.



getInputStream
InputStream getInputStream() throws FileSystemException(Code)
Returns an input stream for reading the file's content.

There may only be a single input or output stream open for the file at any time. An input stream to read the file's content from. The inputstream is buffered, so there is no need to wrap it in aBufferedInputStream.
throws:
  FileSystemException - If the file does not exist, or is being read, or is being written,or on error opening the stream.




getLastModifiedTime
long getLastModifiedTime() throws FileSystemException(Code)
Determines the last-modified timestamp of the file. The last-modified timestamp.
throws:
  FileSystemException - If the file does not exist, or is being written to, or on errordetermining the last-modified timestamp.



getOutputStream
OutputStream getOutputStream() throws FileSystemException(Code)
Returns an output stream for writing the file's content.

If the file does not exist, this method creates it, and the parent folder, if necessary. If the file does exist, it is replaced with whatever is written to the output stream.

There may only be a single input or output stream open for the file at any time. An output stream to write the file's content to. The stream isbuffered, so there is no need to wrap it in aBufferedOutputStream.
throws:
  FileSystemException - If the file is read-only, or is being read, or is being written,or on error opening the stream.




getOutputStream
OutputStream getOutputStream(boolean bAppend) throws FileSystemException(Code)
Returns an output stream for writing the file's content.

If the file does not exist, this method creates it, and the parent folder, if necessary. If the file does exist, it is replaced with whatever is written to the output stream.

There may only be a single input or output stream open for the file at any time.
Parameters:
  bAppend - true if you would like to append to the file An output stream to write the file's content to. The stream isbuffered, so there is no need to wrap it in aBufferedOutputStream.
throws:
  FileSystemException - If the file is read-only, or is being read, or is being written,or on error opening the stream.




getRandomAccessContent
public RandomAccessContent getRandomAccessContent(RandomAccessMode mode) throws FileSystemException(Code)
Returns an stream for reading/writing the file's content.

If the file does not exist, and you use one of the write* methods, this method creates it, and the parent folder, if necessary. If the file does exist, parts of the file are replaced with whatever is written at a given position.

There may only be a single input or output stream open for the file at any time.
throws:
  FileSystemException - If the file is read-only, or is being read, or is being written,or on error opening the stream.




getSize
long getSize() throws FileSystemException(Code)
Determines the size of the file, in bytes. The size of the file, in bytes.
throws:
  FileSystemException - If the file does not exist, or is being written to, or on errordetermining the size.



hasAttribute
boolean hasAttribute(String attrName) throws FileSystemException(Code)
Checks if an attribute of the file's content exists.
Parameters:
  attrName - The name of the attribute.
throws:
  FileSystemException - If the file does not exist, or does not supportattributes.



isOpen
public boolean isOpen()(Code)
check if this file has open streams



removeAttribute
void removeAttribute(String attrName) throws FileSystemException(Code)
Removes the value of an attribute of the file's content.
Parameters:
  attrName - The name of the attribute.
throws:
  FileSystemException - If the file does not exist, or is read-only, or does not supportattributes, or on error removing the attribute.



setAttribute
void setAttribute(String attrName, Object value) throws FileSystemException(Code)
Sets the value of an attribute of the file's content. Creates the file if it does not exist.
Parameters:
  attrName - The name of the attribute.
Parameters:
  value - The value of the attribute.
throws:
  FileSystemException - If the file does not exist, or is read-only, or does not supportattributes, or on error setting the attribute.



setLastModifiedTime
void setLastModifiedTime(long modTime) throws FileSystemException(Code)
Sets the last-modified timestamp of the file. Creates the file if it does not exist.
Parameters:
  modTime - The time to set the last-modified timestamp to.
throws:
  FileSystemException - If the file is read-only, or is being written to, or on errorsetting the last-modified timestamp.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.