Java Doc for FileResource.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » store » access » 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 » Database DBMS » db derby 10.2 » org.apache.derby.iapi.store.access 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.derby.iapi.store.access.FileResource

All known Subclasses:   org.apache.derby.impl.store.raw.data.RFResource,
FileResource
public interface FileResource (Code)
Management of file resources within a database. Suitable for jar files, images etc.

A file resource is identified by the pair (name,generationId). Name is an arbitrary String supplied by the caller. GenerationId is a non-repeating sequence number constructed by the database. Within a database a (name,generationId) pair uniquely identifies a version of a file resource for all time. Newer generation numbers reflect newer versions of the file.

A database supports the concept of a designated current version of a fileResource. The management of the current version is transactional. The following rules apply

  1. Adding a FileResource makes the added version the current version
  2. Removing a FileResource removes the current version of the resource. After this operation the database holds no current version of the FileResoure.
  3. Replacing a FileResource removes the current version of the resource.

For the benefit of replication, a database optionally retains historic versions of stored files. These old versions are useful when processing old transactions in the stage.



Field Summary
final public static  StringJAR_DIRECTORY_NAME
    


Method Summary
public  longadd(String name, InputStream source)
     Add a file resource, copying from the input stream. The InputStream will be closed by this method.
Parameters:
  name - the name of the file resource.
Parameters:
  source - an input stream for reading the content ofthe file resource.
public  StorageFilegetAsFile(String name, long generationId)
     Get the File handle to a file resource.
public  InputStreamgetAsStream(String name, long generationId)
     Get the file resource as a stream.
public  chargetSeparatorChar()
    
public  voidremove(String name, long currentGenerationId, boolean purgeOnCommit)
     Remove the current generation of a file resource from the database.
Parameters:
  name - the name of the fileResource to remove.
Parameters:
  purgeOnCommit - true means purge the fileResource when the current transaction commits.
public  longreplace(String name, long currentGenerationId, InputStream source, boolean purgeOnCommit)
     Replace a file resource with a new version.

The InputStream will be closed by this method.
Parameters:
  name - the name of the file resource.
Parameters:
  source - an input stream for reading the content ofthe file resource.
Parameters:
  purgeOnCommit - true means purge the existing version offileResource when the current transaction commits.


Field Detail
JAR_DIRECTORY_NAME
final public static String JAR_DIRECTORY_NAME(Code)
The name of the jar directory





Method Detail
add
public long add(String name, InputStream source) throws StandardException(Code)
Add a file resource, copying from the input stream. The InputStream will be closed by this method.
Parameters:
  name - the name of the file resource.
Parameters:
  source - an input stream for reading the content ofthe file resource. the generationId for the file resource. Thisquantity increases when you replace the file resource.
exception:
  StandardException - some error occured.



getAsFile
public StorageFile getAsFile(String name, long generationId)(Code)
Get the File handle to a file resource. In some situations higher level code can make optimisations if it can access a file as a File, rather than an output stream. If this call returns null then the resouce is not accessable as a file (e.g. the database is in a zip file).
Parameters:
  name - The name of the fileResource
Parameters:
  generationId - the generationId of the fileResource A File object representing the file, or null ifthe resource is not accessable as a file.



getAsStream
public InputStream getAsStream(String name, long generationId) throws IOException(Code)
Get the file resource as a stream.
exception:
  IOException - some io error occured
exception:
  FileNotFoundException - file does not exist.



getSeparatorChar
public char getSeparatorChar()(Code)
the separator character to be used in file names.



remove
public void remove(String name, long currentGenerationId, boolean purgeOnCommit) throws StandardException(Code)
Remove the current generation of a file resource from the database.
Parameters:
  name - the name of the fileResource to remove.
Parameters:
  purgeOnCommit - true means purge the fileResource when the current transaction commits. false means retainthe file resource for use by replication.
exception:
  StandardException - some error occured.



replace
public long replace(String name, long currentGenerationId, InputStream source, boolean purgeOnCommit) throws StandardException(Code)
Replace a file resource with a new version.

The InputStream will be closed by this method.
Parameters:
  name - the name of the file resource.
Parameters:
  source - an input stream for reading the content ofthe file resource.
Parameters:
  purgeOnCommit - true means purge the existing version offileResource when the current transaction commits. false means retain the existing version for use by replication. the generationId for the new 'current' version of thefile resource.
exception:
  StandardException - some error occured.




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