Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/dghda/module/ModulePathComponent.java


1   /* Copyright (C) 2001 Duane Griffin <duanegriffin@users.sourceforge.net>
2      This file is part of Kent.
3   
4      Kent is free software; you can redistribute it and/or
5      modify it under the terms of the GNU General Public License as
6      published by the Free Software Foundation; either version 2 of the
7      License, or (at your option) any later version.
8   
9      Kent is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     General Public License for more details.
13  
14     You should have received a copy of the GNU General Public
15     License along with Kent; see the file COPYING.  If not,
16     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17     Boston, MA 02111-1307, USA.
18  */
19  
20  package com.dghda.module;
21  
22  /**
23     A module path component interface provides access to zero or more module providers.
24  */
25  public interface ModulePathComponent {
26    
27    /** Details of a provider. */
28    abstract public class Provider {
29      abstract public String getName();
30      abstract public long getModified();
31      abstract public java.io.InputStream getInputStream() throws java.io.IOException;
32    }
33    
34    /** An empty iterator. */
35    public static final class EmptyIterator implements java.util.Iterator {
36      
37      /** Returns false. */
38      public boolean hasNext() {
39        return false;
40      }
41      
42      /** Throws a NoSuchElementException exception. */
43      public Object next() {
44        throw new java.util.NoSuchElementException();
45      }
46      
47      /** Throws a UnsupportedOperationException exception. */
48      public void remove() {
49        throw new UnsupportedOperationException();
50      }
51    }
52    
53    /**
54       Iterate over all providers.
55       The iterator will return a provider object.
56       @param updated If true only new providers or ones which have been modified since the last scan will be returned.
57    */
58    public java.util.Iterator getProviders (boolean updated);
59    
60    /** Returns the path the component was constructed from. */
61    public String getPath();
62  }