01: /*
02: * Enhydra Java Application Server Project
03: *
04: * The contents of this file are subject to the Enhydra Public License
05: * Version 1.1 (the "License"); you may not use this file except in
06: * compliance with the License. You may obtain a copy of the License on
07: * the Enhydra web site ( http://www.enhydra.org/ ).
08: *
09: * Software distributed under the License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11: * the License for the specific terms governing rights and limitations
12: * under the License.
13: *
14: * The Initial Developer of the Enhydra Application Server is Lutris
15: * Technologies, Inc. The Enhydra Application Server and portions created
16: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17: * All Rights Reserved.
18: *
19: * Contributor(s):
20: * Paul Mahar
21: *
22: */
23: package org.enhydra.tool.archive;
24:
25: // ToolBox
26: import org.enhydra.tool.common.PathHandle;
27:
28: //
29: public class Module {
30: private String name = null;
31: private String archive = null;
32:
33: public Module(String filepath) {
34: PathHandle ph = PathHandle.createPathHandle(filepath);
35:
36: setName(ph.getFile().getName());
37: setArchive(ph.getPath());
38: }
39:
40: public String getArchive() {
41: return archive;
42: }
43:
44: public void setArchive(String a) {
45: archive = a;
46: }
47:
48: public String getName() {
49: return name;
50: }
51:
52: // override Object
53: public boolean equals(Object obj) {
54: boolean equal = false;
55:
56: if (obj instanceof Module) {
57: Module mod = (Module) obj;
58:
59: if (mod.getName().equals(getName())) {
60: equal = true;
61: }
62: if (equal) {
63: if (!mod.getArchive().equals(getArchive())) {
64: equal = false;
65: }
66: }
67: }
68: return equal;
69: }
70:
71: private void setName(String n) {
72: name = n;
73: }
74:
75: }
|