Java Doc for MboxFile.java in  » Groupware » hipergate » com » knowgate » hipermail » 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 » Groupware » hipergate » com.knowgate.hipermail 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.knowgate.hipermail.MboxFile

MboxFile
public class MboxFile (Code)
Provides access to an mbox-formatted file.
author:
   Ben Fortuna adapted to hipergate by Sergio Montoro Ten
version:
   3.0


Field Summary
final public static  StringREAD_ONLY
    
final public static  StringREAD_WRITE
    

Constructor Summary
public  MboxFile(File file)
     Constructor.
public  MboxFile(File file, String mode)
     Constructor.
public  MboxFile(String filepath)
     Constructor.
public  MboxFile(String filepath, String mode)
     Constructor.

Method Summary
final public  longappendMessage(MboxFile source, long srcpos, int srcsize)
    
final public  longappendMessage(MboxFile source, int index)
    
final public  longappendMessage(CharSequence message)
     Appends the specified message (represented by a CharSequence) to the mbox file.
public  voidclose()
     Close the mbox file and release any system resources.
public  CharSequencegetMessage(int index)
     Returns a CharSequence containing the data for the message at the specified index.
public  InputStreamgetMessageAsStream(long begin, int size)
    
public  InputStreamgetMessageAsStream(int index)
     Opens an input stream to the specified message data.
public  intgetMessageCount()
     Returns the total number of messages in the mbox file.
public  longgetMessagePosition(int index)
    

Get byte offset position of a given message inside the mbox file

This method is slow when called for the first time, as it has to parse the whole Mbox file for finding each message index.
public  long[]getMessagePositions()
     Returns an initialised array of file positions for all messages in the mbox file.
public  intgetMessageSize(int index)
    
public  InputStreamgetPartAsStream(long begin, long offset, int size)
    
public  voidpurge(int[] messageNumbers)
     Purge the specified messages from the file.
public  longsize()
    

Field Detail
READ_ONLY
final public static String READ_ONLY(Code)



READ_WRITE
final public static String READ_WRITE(Code)




Constructor Detail
MboxFile
public MboxFile(File file) throws FileNotFoundException, IOException(Code)
Constructor.



MboxFile
public MboxFile(File file, String mode) throws FileNotFoundException, IOException(Code)
Constructor.
Parameters:
  file -
Parameters:
  mode - Either MboxFile.READ_ONLY or MboxFile.READ_WRITE



MboxFile
public MboxFile(String filepath)(Code)
Constructor.
Parameters:
  filepath -
Parameters:
  mode - Either MboxFile.READ_ONLY or MboxFile.READ_WRITE



MboxFile
public MboxFile(String filepath, String mode) throws FileNotFoundException, IOException(Code)
Constructor.
Parameters:
  filepath -
Parameters:
  mode - Either MboxFile.READ_ONLY or MboxFile.READ_WRITE




Method Detail
appendMessage
final public long appendMessage(MboxFile source, long srcpos, int srcsize) throws IOException(Code)
Appends the specified message from another mbox file
Parameters:
  source - Source mbox file
Parameters:
  srcpos - Byte offset position of message at source mbox file
Parameters:
  srcsize - Size of source message in bytes byte offset position where message is appended on this mbox file
throws:
  IOException -



appendMessage
final public long appendMessage(MboxFile source, int index) throws IOException(Code)
Appends the specified message from another mbox file
Parameters:
  source - Source mbox file
Parameters:
  index - Index of message to be appended at the source file byte offset position where message is appended on this mbox file
throws:
  IOException -



appendMessage
final public long appendMessage(CharSequence message) throws IOException(Code)
Appends the specified message (represented by a CharSequence) to the mbox file.
Parameters:
  message -



close
public void close() throws IOException(Code)
Close the mbox file and release any system resources.
throws:
  IOException -



getMessage
public CharSequence getMessage(int index) throws IOException(Code)
Returns a CharSequence containing the data for the message at the specified index.
Parameters:
  index - the index of the message to retrieve a CharSequence



getMessageAsStream
public InputStream getMessageAsStream(long begin, int size) throws IOException(Code)
Get message as stream
Parameters:
  begin - long Byte offset position for message
Parameters:
  size - int Number of bytes to be readed InputStream
throws:
  IOException -



getMessageAsStream
public InputStream getMessageAsStream(int index) throws IOException(Code)
Opens an input stream to the specified message data.
Parameters:
  index - the index of the message to opena stream to an input stream



getMessageCount
public int getMessageCount() throws IOException(Code)
Returns the total number of messages in the mbox file. an int



getMessagePosition
public long getMessagePosition(int index) throws IOException, ArrayIndexOutOfBoundsException(Code)

Get byte offset position of a given message inside the mbox file

This method is slow when called for the first time, as it has to parse the whole Mbox file for finding each message index.
Parameters:
  index - Message Index message byte offset position inside the mbox file
throws:
  IOException -
throws:
  ArrayIndexOutOfBoundsException -



getMessagePositions
public long[] getMessagePositions() throws IOException(Code)
Returns an initialised array of file positions for all messages in the mbox file. a long array
throws:
  IOException - thrown when unable to readfrom the specified file channel



getMessageSize
public int getMessageSize(int index) throws IOException, ArrayIndexOutOfBoundsException(Code)
Get size of a message in bytes
Parameters:
  index - Message Index
throws:
  IOException -
throws:
  ArrayIndexOutOfBoundsException -



getPartAsStream
public InputStream getPartAsStream(long begin, long offset, int size) throws IOException(Code)



purge
public void purge(int[] messageNumbers) throws IOException, IllegalArgumentException(Code)
Purge the specified messages from the file.
Parameters:
  messageNumbers - int[]
throws:
  IOException -
throws:
  IllegalArgumentException -



size
public long size() throws IOException(Code)
Return MBox file size in bytes long



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.