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
This commit is contained in:
@@ -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
|
// viztool - a tool for visualizing collections of java classes
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -33,8 +33,6 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.apache.tools.ant.AntClassLoader;
|
import org.apache.tools.ant.AntClassLoader;
|
||||||
@@ -195,20 +193,11 @@ public class DriverTask extends Task
|
|||||||
// tell our printjob to print to a file
|
// tell our printjob to print to a file
|
||||||
PrintRequestAttributeSet attrs =
|
PrintRequestAttributeSet attrs =
|
||||||
new HashPrintRequestAttributeSet();
|
new HashPrintRequestAttributeSet();
|
||||||
String outpath = _output.getPath();
|
attrs.add(new Destination(_output.toURI()));
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// invoke the printing process
|
// invoke the printing process
|
||||||
try {
|
try {
|
||||||
log("Generating visualization to '" + outpath + "'.");
|
log("Generating visualization to '" + _output.getPath() + "'.");
|
||||||
job.print(attrs);
|
job.print(attrs);
|
||||||
} catch (PrinterException pe) {
|
} catch (PrinterException pe) {
|
||||||
throw new BuildException("Error printing visualization.", pe);
|
throw new BuildException("Error printing visualization.", pe);
|
||||||
|
|||||||
Reference in New Issue
Block a user