01: /**
02: * JavaGuard -- an obfuscation package for Java classfiles.
03: *
04: * Copyright (c) 2002 Thorsten Heit (theit@gmx.de)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: *
20: * The author may be contacted at theit@gmx.de.
21: *
22: *
23: * $Id: FileContainer.java,v 1.3 2002/06/03 13:02:35 glurk Exp $
24: */package net.sf.javaguard;
25:
26: import java.io.IOException;
27: import java.util.Enumeration;
28: import java.util.SortedSet;
29: import java.util.jar.Manifest;
30:
31: /** The purpose of a FileContainer is to ease the handling of a list of files
32: * created for example from the entries of a Jar file or from the contents of a
33: * local directory that match a given regular expression.
34: *
35: * @author <a href="mailto:theit@gmx.de">Thorsten Heit</a>
36: */
37: public interface FileContainer {
38: /** Returns the name for the file container.
39: * @return the name for the file container
40: */
41: public String getName();
42:
43: /** Returns the Manifest file for the file container.
44: * @return Manifest file
45: * @throws IOException if an I/O error occurs
46: */
47: public Manifest getManifest() throws IOException;
48:
49: /** Returns a sorted set of the file names in this file container. Each
50: * element in the set must be a string in which packages/directories are
51: * separated by "/".
52: * @return a sorted set of file names; must not be null
53: */
54: public SortedSet getFileNameSet();
55:
56: /** Removes file entries in the current file container that are already
57: * contained in the given file container.
58: * @param fileContainer the file container to compare to
59: */
60: public void removeDuplicates(FileContainer fileContainer);
61:
62: /** Returns an enumeration of the elements of the file container. The
63: * <code>nextElement()</code> method of such an enumeration must return a
64: * subclass of {@link FileEntry}.
65: * @return an enumeration of the elements of the file container
66: */
67: public Enumeration enumeration();
68: }
|