org.objectweb.jonas.server
Class JURLs

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by org.objectweb.jonas.server.JURLs
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class JURLs
extends java.util.Vector

This implements an utility class that list the URLs of the jars to load at the launch time of the JOnAS server.

Author:
Ludovic Bert, Florent Benoit
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
JURLs()
          Construct an empty JURLs.
 
Method Summary
 void add(java.io.File file)
          Add the specified file or directory to this JURLs.
 void add(java.io.File file, java.lang.String filter)
          Add the content of the specified directory to this JURLs, by using the specified filter.
 void add(java.io.File file, java.lang.String filter, java.lang.String prefix, java.lang.String suffix)
          Add the content of the specified directory to this JURLs by using a file filter and if the contained file not starts with the prefix and not ends with the suffix.
 void addDir(java.io.File file)
          Add the specified directory to this JURLs.
 void addNotEndWith(java.io.File file, java.lang.String suffix)
          Add the content of the specified directory to this JURLs if the contained file not ends with the specified suffix.
 void addNotStartWith(java.io.File file, java.lang.String prefix)
          Add the content of the specified directory to this JURLs if the contained file not starts with the specified prefix.
 void merge(JURLs jurl)
          Merge the specified JURls to this JURLs.
 void remove(java.io.File file)
          Remove the specified file of this JURLs
 java.net.URL[] toURLs()
          Return an array containing all the URLs of this JURLs.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

JURLs

public JURLs()
Construct an empty JURLs.

Method Detail

add

public void add(java.io.File file)
         throws java.net.MalformedURLException
Add the specified file or directory to this JURLs. Note that in the case of a directory this method add only the content of this one.

Parameters:
file - the specified file or directory to add to this JURLs.
Throws:
java.net.MalformedURLException - to indicate that a malformed URL has occured.

addDir

public void addDir(java.io.File file)
            throws java.net.MalformedURLException
Add the specified directory to this JURLs. Note that this method add the URL of the specified directory and not the content of this directory.

Parameters:
file - the directory to add to this JURLs.
Throws:
java.net.MalformedURLException - to indicate that a malformed URL has occured.

add

public void add(java.io.File file,
                java.lang.String filter)
         throws java.net.MalformedURLException
Add the content of the specified directory to this JURLs, by using the specified filter.

Parameters:
file - the directory to add to this JURLs.
filter - the filter to use to add the content of this directory, null if not use the filter.
Throws:
java.net.MalformedURLException - to indicate that a malformed URL has occured.

addNotStartWith

public void addNotStartWith(java.io.File file,
                            java.lang.String prefix)
                     throws java.net.MalformedURLException
Add the content of the specified directory to this JURLs if the contained file not starts with the specified prefix.

Parameters:
file - the directory to add to this JURLs.
prefix - the prefix to ignore, null if not use the prefix.
Throws:
java.net.MalformedURLException - to indicate that a malformed URL has occured.

addNotEndWith

public void addNotEndWith(java.io.File file,
                          java.lang.String suffix)
                   throws java.net.MalformedURLException
Add the content of the specified directory to this JURLs if the contained file not ends with the specified suffix.

Parameters:
file - the directory to add to this JURLs.
suffix - the suffix to ignore, null if not use the suffix.
Throws:
java.net.MalformedURLException - to indicate that a malformed URL has occured.

add

public void add(java.io.File file,
                java.lang.String filter,
                java.lang.String prefix,
                java.lang.String suffix)
         throws java.net.MalformedURLException
Add the content of the specified directory to this JURLs by using a file filter and if the contained file not starts with the prefix and not ends with the suffix.

Parameters:
file - the directory to add to this JURLs.
filter - the filter to use to add the content of this directory, null if not use the filter.
prefix - the prefix to ignore, null if not use the prefix.
suffix - the suffix to ignore, null if not use the suffix.
Throws:
java.net.MalformedURLException - to indicate that a malformed URL has occured.

merge

public void merge(JURLs jurl)
Merge the specified JURls to this JURLs.

Parameters:
jurl - the JURls to merge with this JURLs.

remove

public void remove(java.io.File file)
            throws java.net.MalformedURLException
Remove the specified file of this JURLs

Parameters:
file - the file to be removed
Throws:
java.net.MalformedURLException - to indicate that a malformed URL has occured.

toURLs

public java.net.URL[] toURLs()
Return an array containing all the URLs of this JURLs.

Returns:
an array containing all the URLs of this JURLs.