if (dest == DestinationType.FILE &&
pServ.isAttributeCategorySupported(Destination.class)) {
String fileName = jobAttributes.getFileName();
Destination defaultDest;
if (fileName == null && (defaultDest = (Destination)pServ.
getDefaultAttributeValue(Destination.class)) != null) {
attributes.add(defaultDest);
} else {
URI uri = null;
try {
if (fileName != null) {
if (fileName.equals("")) {
fileName = ".";
}
} else {
// defaultDest should not be null. The following code
// is only added to safeguard against a possible
// buggy implementation of a PrintService having a
// null default Destination.
fileName = "out.prn";
}
uri = (new File(fileName)).toURI();
} catch (SecurityException se) {
try {
// '\\' file separator is illegal character in opaque
// part and causes URISyntaxException, so we replace
// it with '/'
fileName = fileName.replace('\\', '/');
uri = new URI("file:"+fileName);
} catch (URISyntaxException e) {
}
}
if (uri != null) {
attributes.add(new Destination(uri));
}
}
}
attributes.add(new SunMinMaxPage(jobAttributes.getMinPage(),
jobAttributes.getMaxPage()));