From 5e756bac241d9b8d2119bd11086966db510e1e92 Mon Sep 17 00:00:00 2001 From: mdb Date: Mon, 3 Dec 2001 09:14:11 +0000 Subject: [PATCH] Use File.toURI() rather than build the URI by hand. git-svn-id: https://samskivert.googlecode.com/svn/trunk@500 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../java/com/samskivert/viztool/DriverTask.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/projects/viztool/src/java/com/samskivert/viztool/DriverTask.java b/projects/viztool/src/java/com/samskivert/viztool/DriverTask.java index 90f4416e..0b9f1802 100644 --- a/projects/viztool/src/java/com/samskivert/viztool/DriverTask.java +++ b/projects/viztool/src/java/com/samskivert/viztool/DriverTask.java @@ -1,5 +1,5 @@ // -// $Id: DriverTask.java,v 1.2 2001/12/03 08:53:45 mdb Exp $ +// $Id: DriverTask.java,v 1.3 2001/12/03 09:14:11 mdb Exp $ // // viztool - a tool for visualizing collections of java classes // Copyright (C) 2001 Michael Bayne @@ -33,8 +33,6 @@ import java.io.File; import java.io.IOException; import java.net.URI; -import java.net.URISyntaxException; - import java.util.ArrayList; import org.apache.tools.ant.AntClassLoader; @@ -195,20 +193,11 @@ public class DriverTask extends Task // tell our printjob to print to a file PrintRequestAttributeSet attrs = new HashPrintRequestAttributeSet(); - String outpath = _output.getPath(); - try { - URI target = new URI("file:" + outpath); - attrs.add(new Destination(target)); - - } catch (URISyntaxException use) { - String errmsg = "Can't create URI for 'output' file path? " + - "[output=" + outpath + "]."; - throw new BuildException(errmsg, use); - } + attrs.add(new Destination(_output.toURI())); // invoke the printing process try { - log("Generating visualization to '" + outpath + "'."); + log("Generating visualization to '" + _output.getPath() + "'."); job.print(attrs); } catch (PrinterException pe) { throw new BuildException("Error printing visualization.", pe);