org.fcrepo.server.utilities
Class PIDStreamIterableWrapper

java.lang.Object
  extended by org.fcrepo.server.utilities.PIDStreamIterableWrapper
All Implemented Interfaces:
Iterable<String>

public final class PIDStreamIterableWrapper
extends Object
implements Iterable<String>

Iterable implementation over a stream containing PIDs. Allows a stream containing a list of pids to be iterated in a for (String pid : wrapper) statement. Stream must contain either:

  • Raw list of PIDs, separated by newlines (blank lines are skipped)
  • XML containing <pid> elements. Structure of XML is not interpreted, only single lines containing this element are read. Only one PID per line. Empty pid elements (<pid/>) will be skipped. This is compatible with basic search output
  • Version:
    $Id$
    Author:
    Stephen Bayliss

    Constructor Summary
    PIDStreamIterableWrapper(InputStream stream)
               
     
    Method Summary
     Iterator<String> iterator()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    PIDStreamIterableWrapper

    public PIDStreamIterableWrapper(InputStream stream)
                             throws IOException
    Throws:
    IOException
    Method Detail

    iterator

    public Iterator<String> iterator()
    Specified by:
    iterator in interface Iterable<String>


    Copyright © 2011 DuraSpace. All Rights Reserved.