[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Thu Dec 6 18:48:54 UTC 2007


gordonp
Thu Dec  6 13:48:54 EST 2007
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util
In directory dev.open-bio.org:/tmp/cvs-serv26686/src/main/ca/ucalgary/seahawk/util

Modified Files:
	MinJarMaker.java 
Log Message:
Got rid of deprecated calls to File.toURL()
moby-live/Java/src/main/ca/ucalgary/seahawk/util MinJarMaker.java,1.5,1.6
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MinJarMaker.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MinJarMaker.java	2006/12/06 16:07:10	1.5
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/MinJarMaker.java	2007/12/06 18:48:54	1.6
@@ -265,7 +265,7 @@
 	    String classPathElement = classPathTokens.nextToken();
 	    String urlPrefix = null;
 	    try{
-		urlPrefix = (new File(classPathElement)).toURL().toString();
+		urlPrefix = (new File(classPathElement)).toURI().toURL().toString();
 	    }
 	    catch(Exception e){
 		System.err.println("Warning: can't generate URL from classpath element " + classPathElement + ", " +e);
@@ -360,7 +360,7 @@
 	    File resourceFile = new File(path);
 	    if(resourceFile.isFile()){
 		try{
-		    return resourceFile.toURL();
+		    return resourceFile.toURI().toURL();
 		}
 		catch(Exception e){
 		    System.err.println("Warning: tried to return properties file " + 
@@ -393,10 +393,10 @@
 		    }
 		    else{
 			try{
-			    return new URL("jar:"+f.toURL().toString()+"!/"+name);
+			    return new URL("jar:"+f.toURI().toURL().toString()+"!/"+name);
 			} catch(java.net.MalformedURLException murle){
 			    try{
-				System.err.println("URL jar:"+f.toURL().toString()+"!"+name + 
+				System.err.println("URL jar:"+f.toURI().toURL().toString()+"!"+name + 
 						   " was invalid: " +murle);}catch(Exception e){}
 			    return null;
 			}
@@ -436,7 +436,7 @@
     protected void createManifest(JarOutputStream jout) throws IOException{
 	JarEntry je = new JarEntry(MANIFEST_PATH);
 	jout.putNextEntry( je );
-	copyFile( jout, new StringBufferInputStream("Main-Class: "+manifestMainClass.getName()+"\n"));
+	copyFile( jout, ("Main-Class: "+manifestMainClass.getName()+"\n").getBytes());
 	jout.closeEntry();
     }
 




More information about the MOBY-guts mailing list