Author: mes
Date: 2010-02-02 12:14:41 -0800 (Tue, 02 Feb 2010)
New Revision: 19135
Modified:
cytoscape/trunk/src/cytoscape/plugin/JarUtil.java
Log:
just changed some formatting
Modified: cytoscape/trunk/src/cytoscape/plugin/JarUtil.java
===================================================================
--- cytoscape/trunk/src/cytoscape/plugin/JarUtil.java 2010-02-02 20:12:28 UTC
(rev 19134)
+++ cytoscape/trunk/src/cytoscape/plugin/JarUtil.java 2010-02-02 20:14:41 UTC
(rev 19135)
@@ -1,5 +1,40 @@
package cytoscape.plugin;
+/*
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -21,8 +56,10 @@
*/
class JarUtil {
- // Bug 2055 changing regexp used to match jars
- // Was "\\w+\\.jar", which seemed unecessarily restrictive
+ /**
+ * Bug 2055 changing regexp used to match jars
+ * Was "\\w+\\.jar", which seemed unecessarily restrictive
+ */
static final String MATCH_JAR_REGEXP = ".*\\.jar$";
/**
@@ -39,12 +76,12 @@
switch (type) {
case JAR:
JarFile jar = new JarFile(fileName);
- try {
- pluginClassName = getManifestAttribute(jar.getManifest());
- } finally {
- if (jar != null)
- jar.close();
- }
+ try {
+ pluginClassName =
getManifestAttribute(jar.getManifest());
+ } finally {
+ if (jar != null)
+ jar.close();
+ }
break;
case ZIP:
@@ -53,47 +90,46 @@
if (Entries.size() <= 0) {
String[] FilePath = fileName.split("/");
fileName = FilePath[FilePath.length - 1];
- throw new IOException(
- fileName
- + " does not
contain any jar files or is not a zip file.");
+ throw new IOException( fileName +
+ " does not contain any
jar files or is not a zip file.");
}
- ZipFile zf = null;
+ ZipFile zf = null;
- try {
+ try {
zf = new ZipFile(fileName);
- for (ZipEntry entry : Entries) {
- String entryName = entry.getName();
+ for (ZipEntry entry : Entries) {
+ String entryName = entry.getName();
- InputStream is = null;
+ InputStream is = null;
- try {
- JarInputStream jis = null;
+ try {
+ JarInputStream jis = null;
is = ZipUtil.readFile(zf,
entryName);
- try {
+ try {
jis = new
JarInputStream(is);
- pluginClassName =
getManifestAttribute(jis.getManifest());
- } finally {
- if (jis != null)
- jis.close();
- }
- } finally {
- if (is != null)
- is.close();
- }
- }
- } finally {
- if (zf != null)
- zf.close();
- }
+ pluginClassName =
getManifestAttribute(jis.getManifest());
+ } finally {
+ if (jis != null)
+ jis.close();
+ }
+ } finally {
+ if (is != null)
+ is.close();
+ }
+ }
+ } finally {
+ if (zf != null)
+ zf.close();
+ }
}
} catch (Throwable t) {
throw new IOException(t);
}
- return pluginClassName;
+ return pluginClassName;
}
/*
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.