org.archive.crawler.writer
Class MirrorWriterProcessor.EndSegment

java.lang.Object
  extended by org.archive.crawler.writer.MirrorWriterProcessor.PathSegment
      extended by org.archive.crawler.writer.MirrorWriterProcessor.EndSegment
Enclosing class:
MirrorWriterProcessor

 class MirrorWriterProcessor.EndSegment
extends MirrorWriterProcessor.PathSegment

This class represents the last segment (component) of a URI path.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.archive.crawler.writer.MirrorWriterProcessor.PathSegment
MirrorWriterProcessor.PathSegment.CaseInsensitiveFilenameFilter
 
Field Summary
 
Fields inherited from class org.archive.crawler.writer.MirrorWriterProcessor.PathSegment
curi, EXISTS_CASE_INSENSITIVE_MATCH, EXISTS_EXACT_MATCH, EXISTS_NOT, mainPart, maxSegLen
 
Constructor Summary
MirrorWriterProcessor.EndSegment(java.lang.String uriPath, int beginIndex, int endIndex, int maxSegLen, boolean caseSensitive, CrawlURI curi, java.util.Map characterMap, java.lang.String dotBegin, java.lang.String query, java.lang.String suffix, int maxPathLen, boolean suffixAtEnd)
          Creates an EndSegment.
 
Method Summary
(package private)  void addToPath(MirrorWriterProcessor.URIToFileReturn currentPath)
          Adds this segment to a file path.
 
Methods inherited from class org.archive.crawler.writer.MirrorWriterProcessor.PathSegment
existsMaybeCaseSensitive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MirrorWriterProcessor.EndSegment

MirrorWriterProcessor.EndSegment(java.lang.String uriPath,
                                 int beginIndex,
                                 int endIndex,
                                 int maxSegLen,
                                 boolean caseSensitive,
                                 CrawlURI curi,
                                 java.util.Map characterMap,
                                 java.lang.String dotBegin,
                                 java.lang.String query,
                                 java.lang.String suffix,
                                 int maxPathLen,
                                 boolean suffixAtEnd)
Creates an EndSegment.

Parameters:
uriPath - the path part of the URI
beginIndex - the beginning index, inclusive, of the substring of uriPath to be used
endIndex - the ending index, exclusive, of the substring of uriPath to be used
maxSegLen - the maximum number of characters allowed in one file system path segment (component)
caseSensitive - if true, the file system is assumed to be case-sensitive; otherwise the file system is assumed to be case-insensitive but case-preserving
curi - the URI
characterMap - maps characters (as length-1 String values) in the URI path and query to replacement String values
dotBegin - if non-null, this replaces a '.' at the beginning of the segment
query - the query part of the URI, or null if none
suffix - if non-null, use this as the suffix in preference to any suffix that uriPath might have
maxPathLen - the maximum number of characters allowed in a file system path
suffixAtEnd - if true, the suffix is placed at the end of the path, after the query (if any); otherwise, the suffix is placed before the query
Throws:
java.lang.IllegalArgumentException - if beginIndex is negative.
java.lang.IllegalArgumentException - if endIndex is less than beginIndex.
java.lang.IllegalArgumentException - if maxSegLen is too small.
Method Detail

addToPath

void addToPath(MirrorWriterProcessor.URIToFileReturn currentPath)
Description copied from class: MirrorWriterProcessor.PathSegment
Adds this segment to a file path. This is the key method of this class. It extends the given path by one segment, named to obey all constraints. A new directory is created if necessary.

Specified by:
addToPath in class MirrorWriterProcessor.PathSegment
Parameters:
currentPath - the current path, to which this segment is added


Copyright © 2003-2011 Internet Archive. All Rights Reserved.