Java Doc for ExperimentalWARCWriter.java in  » Web-Crawler » heritrix » org » archive » io » warc » 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 » Web Crawler » heritrix » org.archive.io.warc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.archive.io.WriterPoolMember
      org.archive.io.warc.ExperimentalWARCWriter

ExperimentalWARCWriter
public class ExperimentalWARCWriter extends WriterPoolMember implements WARCConstants(Code)
Experimental WARC implementation.

Assumption is that the caller is managing access to this ExperimentalWARCWriter ensuring only one thread accessing this WARC instance at any one time.

While being written, WARCs have a '.open' suffix appended.
author:
   stack
version:
   $Revision: 4604 $ $Date: 2006-09-05 22:38:18 -0700 (Tue, 05 Sep 2006) $



Field Summary
public static  byte[]CRLF_BYTES
     NEWLINE as bytes.

Constructor Summary
 ExperimentalWARCWriter()
     Shutdown Constructor Has default access so can make instance to test utility methods.
public  ExperimentalWARCWriter(AtomicInteger serialNo, OutputStream out, File f, boolean cmprs, String a14DigitDate, List warcinfoData)
     Constructor. Takes a stream.
public  ExperimentalWARCWriter(AtomicInteger serialNo, List<File> dirs, String prefix, String suffix, boolean cmprs, long maxSize, List warcinfoData)
     Constructor.
Parameters:
  dirs - Where to drop files.
Parameters:
  prefix - File prefix to use.
Parameters:
  cmprs - Compress the records written.

Method Summary
protected  voidbaseCharacterCheck(char c, String parameter)
    
protected  StringcheckHeaderLineMimetypeParameter(String parameter)
    
protected  StringcheckHeaderValue(String value)
    
protected  StringcreateFile(File file)
    
protected  StringcreateRecordHeader(String type, String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord xtraHeaders, long contentLength)
    
protected  URIgenerateRecordId(Map<String, String> qualifiers)
    
protected  URIgenerateRecordId(String key, String value)
    
public static  URIgetRecordID()
     Convenience method for getting Record-Ids.
public  voidwriteMetadataRecord(String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream metadata, long metadataLength)
    
protected  voidwriteRecord(String type, String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord xtraHeaders, InputStream contentStream, long contentLength)
    
public  voidwriteRequestRecord(String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream request, long requestLength)
    
public  voidwriteResourceRecord(String url, String create14DigitDate, String mimetype, ANVLRecord namedFields, InputStream response, long responseLength)
    
public  voidwriteResourceRecord(String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream response, long responseLength)
    
public  voidwriteResponseRecord(String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream response, long responseLength)
    
public  voidwriteRevisitRecord(String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream response, long responseLength)
    
public  URIwriteWarcinfoRecord(String filename)
    
public  URIwriteWarcinfoRecord(String filename, String description)
    
public  URIwriteWarcinfoRecord(String mimetype, ANVLRecord namedFields, InputStream fileMetadata, long fileMetadataLength)
     Write a warcinfo to current file. TODO: Write crawl metadata or pointers to crawl description.
Parameters:
  mimetype - Mimetype of the fileMetadata block.
Parameters:
  namedFields - Named fields.
public  voidwriteWarcinfoRecord(String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream fileMetadata, long fileMetadataLength)
     Write a warcinfo to current file.

Field Detail
CRLF_BYTES
public static byte[] CRLF_BYTES(Code)
NEWLINE as bytes.




Constructor Detail
ExperimentalWARCWriter
ExperimentalWARCWriter()(Code)
Shutdown Constructor Has default access so can make instance to test utility methods.



ExperimentalWARCWriter
public ExperimentalWARCWriter(AtomicInteger serialNo, OutputStream out, File f, boolean cmprs, String a14DigitDate, List warcinfoData) throws IOException(Code)
Constructor. Takes a stream. Use with caution. There is no upperbound check on size. Will just keep writing. Only pass Streams that are bounded.
Parameters:
  serialNo - used to generate unique file name sequences
Parameters:
  out - Where to write.
Parameters:
  f - File the out is connected to.
Parameters:
  cmprs - Compress the content written.
Parameters:
  a14DigitDate - If null, we'll write current time.
throws:
  IOException -



ExperimentalWARCWriter
public ExperimentalWARCWriter(AtomicInteger serialNo, List<File> dirs, String prefix, String suffix, boolean cmprs, long maxSize, List warcinfoData)(Code)
Constructor.
Parameters:
  dirs - Where to drop files.
Parameters:
  prefix - File prefix to use.
Parameters:
  cmprs - Compress the records written.
Parameters:
  maxSize - Maximum size for ARC files written.
Parameters:
  suffix - File tail to use. If null, unused.
Parameters:
  warcinfoData - File metadata for warcinfo record.




Method Detail
baseCharacterCheck
protected void baseCharacterCheck(char c, String parameter) throws IOException(Code)



checkHeaderLineMimetypeParameter
protected String checkHeaderLineMimetypeParameter(String parameter) throws IOException(Code)



checkHeaderValue
protected String checkHeaderValue(String value) throws IOException(Code)



createFile
protected String createFile(File file) throws IOException(Code)



createRecordHeader
protected String createRecordHeader(String type, String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord xtraHeaders, long contentLength) throws IOException(Code)



generateRecordId
protected URI generateRecordId(Map<String, String> qualifiers) throws IOException(Code)



generateRecordId
protected URI generateRecordId(String key, String value) throws IOException(Code)



getRecordID
public static URI getRecordID() throws IOException(Code)
Convenience method for getting Record-Ids. A record ID.
throws:
  IOException -



writeMetadataRecord
public void writeMetadataRecord(String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream metadata, long metadataLength) throws IOException(Code)



writeRecord
protected void writeRecord(String type, String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord xtraHeaders, InputStream contentStream, long contentLength) throws IOException(Code)



writeRequestRecord
public void writeRequestRecord(String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream request, long requestLength) throws IOException(Code)



writeResourceRecord
public void writeResourceRecord(String url, String create14DigitDate, String mimetype, ANVLRecord namedFields, InputStream response, long responseLength) throws IOException(Code)



writeResourceRecord
public void writeResourceRecord(String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream response, long responseLength) throws IOException(Code)



writeResponseRecord
public void writeResponseRecord(String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream response, long responseLength) throws IOException(Code)



writeRevisitRecord
public void writeRevisitRecord(String url, String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream response, long responseLength) throws IOException(Code)



writeWarcinfoRecord
public URI writeWarcinfoRecord(String filename) throws IOException(Code)



writeWarcinfoRecord
public URI writeWarcinfoRecord(String filename, String description) throws IOException(Code)



writeWarcinfoRecord
public URI writeWarcinfoRecord(String mimetype, ANVLRecord namedFields, InputStream fileMetadata, long fileMetadataLength) throws IOException(Code)
Write a warcinfo to current file. TODO: Write crawl metadata or pointers to crawl description.
Parameters:
  mimetype - Mimetype of the fileMetadata block.
Parameters:
  namedFields - Named fields. Pass null if none.
Parameters:
  fileMetadata - Metadata about this WARC as RDF, ANVL, etc.
Parameters:
  fileMetadataLength - Length of fileMetadata.
throws:
  IOException - Generated record-id made withdata: scheme andthe current filename.



writeWarcinfoRecord
public void writeWarcinfoRecord(String create14DigitDate, String mimetype, URI recordId, ANVLRecord namedFields, InputStream fileMetadata, long fileMetadataLength) throws IOException(Code)
Write a warcinfo to current file. The warcinfo type uses its recordId as its URL.
Parameters:
  recordId - URI to use for this warcinfo.
Parameters:
  create14DigitDate - Record creation date as 14 digit date.
Parameters:
  mimetype - Mimetype of the fileMetadata.
Parameters:
  namedFields - Named fields.
Parameters:
  fileMetadata - Metadata about this WARC as RDF, ANVL, etc.
Parameters:
  fileMetadataLength - Length of fileMetadata.
throws:
  IOException -



Fields inherited from org.archive.io.WriterPoolMember
final public static String DEFAULT_PREFIX(Code)(Java Doc)
final public static String DEFAULT_SUFFIX(Code)(Java Doc)
final public static String HOSTNAME_VARIABLE(Code)(Java Doc)
final public static String UTF8(Code)(Java Doc)

Methods inherited from org.archive.io.WriterPoolMember
public void checkSize() throws IOException(Code)(Java Doc)
protected File checkWriteable(File d)(Code)(Java Doc)
public void close() throws IOException(Code)(Java Doc)
protected String createFile() throws IOException(Code)(Java Doc)
protected String createFile(File file) throws IOException(Code)(Java Doc)
protected void flush() throws IOException(Code)(Java Doc)
protected String getBaseFilename()(Code)(Java Doc)
protected String getCreateTimestamp()(Code)(Java Doc)
public File getFile()(Code)(Java Doc)
protected File getNextDirectory(List<File> dirs) throws IOException(Code)(Java Doc)
protected OutputStream getOutputStream()(Code)(Java Doc)
public long getPosition() throws IOException(Code)(Java Doc)
protected synchronized TimestampSerialno getTimestampSerialNo()(Code)(Java Doc)
protected synchronized TimestampSerialno getTimestampSerialNo(String timestamp)(Code)(Java Doc)
public boolean isCompressed()(Code)(Java Doc)
protected void postWriteRecordTasks() throws IOException(Code)(Java Doc)
protected void preWriteRecordTasks() throws IOException(Code)(Java Doc)
protected void readFullyFrom(InputStream is, long recordLength, byte[] b) throws IOException(Code)(Java Doc)
protected void readToLimitFrom(InputStream is, long limit, byte[] b) throws IOException(Code)(Java Doc)
protected void write(byte[] b) throws IOException(Code)(Java Doc)
protected void write(byte[] b, int off, int len) throws IOException(Code)(Java Doc)
protected void write(int b) throws IOException(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.