org.archive.crawler.writer
Class MirrorWriterProcessor.DirSegment
java.lang.Object
org.archive.crawler.writer.MirrorWriterProcessor.PathSegment
org.archive.crawler.writer.MirrorWriterProcessor.DirSegment
- Enclosing class:
- MirrorWriterProcessor
class MirrorWriterProcessor.DirSegment
- extends MirrorWriterProcessor.PathSegment
This class represents one directory segment (component) of a URI path.
|
Constructor Summary |
MirrorWriterProcessor.DirSegment(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 dotEnd,
java.util.Set underscoreSet)
Creates a DirSegment. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MirrorWriterProcessor.DirSegment
MirrorWriterProcessor.DirSegment(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 dotEnd,
java.util.Set underscoreSet)
- Creates a DirSegment.
- Parameters:
uriPath - the path part of the URIbeginIndex - the beginning index, inclusive, of the substring
of uriPath to be usedendIndex - the ending index, exclusive, of the substring
of uriPath to be usedmaxSegLen - 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-preservingcuri - the URIcharacterMap - a map from characters
(as length-1 String values) in
the URI path and query to replacement String valuesdotBegin - if non-null, this replaces a '.' at
the beginning of the directory namedotEnd - if non-null, this replaces a '.'
that appears at the end of a directory nameunderscoreSet - if non-null and a segment, after conversion
to lower case, is in this set, then prepend an underscore
to the segment
- 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.
addToPath
void addToPath(MirrorWriterProcessor.URIToFileReturn currentPath)
throws java.io.IOException
- 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
- Throws:
java.io.IOException - if a needed directory could not be created
Copyright © 2003-2009 Internet Archive. All Rights Reserved.