classUtils.pack.util
Class ClassPathIterator

java.lang.Object
  extended by classUtils.pack.util.ClassPathIterator
All Implemented Interfaces:
java.util.Iterator

public class ClassPathIterator
extends java.lang.Object
implements java.util.Iterator

An iterator over a classpath declaration.

Author:
Cristiano Sadun

Constructor Summary
ClassPathIterator()
          Create a ClassPathIterator iterating on the system class path.
ClassPathIterator(java.lang.String classpath)
          Create a ClassPathIterator iterating on the given class path.
 
Method Summary
 boolean hasNext()
           
 boolean isDirectory()
          Returns whether the entry where the iterator is positioned is a JAR or not, regardless of its existence.
 boolean isDirectory(boolean checkExistence)
          Returns whether the entry where the iterator is positioned is a JAR or not
 boolean isJar()
          Returns whether the entry where the iterator is positioned is a JAR or not, regardless of its existence.
 boolean isJar(boolean checkExistence)
          Returns whether the entry where the iterator is positioned is a JAR or not
 java.lang.Object next()
          Return the next entry as a String
 java.io.File nextEntryFile()
          Return the next entry in the class path as a File
 java.lang.String nextEntryString()
          Return the next entry in the class path as a String
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathIterator

public ClassPathIterator(java.lang.String classpath)
Create a ClassPathIterator iterating on the given class path.

Parameters:
classpath - string to iterate on

ClassPathIterator

public ClassPathIterator()
Create a ClassPathIterator iterating on the system class path.

Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
See Also:
Iterator.hasNext()

next

public java.lang.Object next()
Return the next entry as a String

Specified by:
next in interface java.util.Iterator
See Also:
Iterator.next()

nextEntryString

public java.lang.String nextEntryString()
Return the next entry in the class path as a String


nextEntryFile

public java.io.File nextEntryFile()
Return the next entry in the class path as a File


remove

public void remove()
Specified by:
remove in interface java.util.Iterator
See Also:
Iterator.remove()

isJar

public boolean isJar(boolean checkExistence)
Returns whether the entry where the iterator is positioned is a JAR or not

Parameters:
checkExistence - also checks if the JAR exists.

isJar

public boolean isJar()
Returns whether the entry where the iterator is positioned is a JAR or not, regardless of its existence.


isDirectory

public boolean isDirectory(boolean checkExistence)
Returns whether the entry where the iterator is positioned is a JAR or not

Parameters:
checkExistence - also checks if the JAR exists.

isDirectory

public boolean isDirectory()
Returns whether the entry where the iterator is positioned is a JAR or not, regardless of its existence.