Find JSRs
Submit this Search


Ad Banner
 
 
 
 

JPS API (JSR-06) Change Log
 
 
 
Java Print Service API Specification
JSR-06 Change Log
2002/1/10
 
 

PROPOSED CHANGES

Please send comments on these proposed changes to jsr-6-comments@jcp.org.

1-2. Errata for the Proposed Final Draft

Some small but significant problems were discovered in the JSR-06 specification after the Proposed Final Draft was submitted. In order to prevent these from becoming a permanent part of the specification we propose to repair them before the Final Release. The repaired API will be implemented by the initial release of the Java 2 Platform, Standard Edition (J2SE), version 1.4. We apologize for these errors, but we are fortunate to have found them in time to fix them.

1: Public static variables not  declared final

In the Proposed Final Draft the javax.print.DocFlavor class has several inner classes, each of which define a number of static
variables which are instances of their  respective enclosing classes.  These static variables are by design constant values and
should be immutable, thus should be declared final.  By oversight the final modifier is missing from these declarations.
The proposed change is to add the final modifer. The change neither adds nor removes functionality from the API. It just corrects what is otherwise a minor security hole in the API. There would be no genuine reason for any client to update the value of these intended constants.

To repair these errors we propose to add the final modifier to these declarations. Their new signatures will be (changes are in green):

 
 class DocFlavor.BYTE_ARRAY :-
    public static final DocFlavor.BYTE_ARRAY TEXT_PLAIN_HOST;
    public static final DocFlavor.BYTE_ARRAY TEXT_PLAIN_UTF_8;
    public static final DocFlavor.BYTE_ARRAY TEXT_PLAIN_UTF_16;
    public static final DocFlavor.BYTE_ARRAY TEXT_PLAIN_UTF_16BE;
    public static final DocFlavor.BYTE_ARRAY TEXT_PLAIN_UTF_16LE;
    public static final DocFlavor.BYTE_ARRAY TEXT_PLAIN_US_ASCII;
    public static final DocFlavor.BYTE_ARRAY TEXT_HTML_HOST;
    public static final DocFlavor.BYTE_ARRAY TEXT_HTML_UTF_8;
    public static final DocFlavor.BYTE_ARRAY TEXT_HTML_UTF_16;
    public static final DocFlavor.BYTE_ARRAY TEXT_HTML_UTF_16BE;
    public static final DocFlavor.BYTE_ARRAY TEXT_HTML_UTF_16LE;
    public static final DocFlavor.BYTE_ARRAY TEXT_HTML_US_ASCII;
    public static final DocFlavor.BYTE_ARRAY PDF;
    public static final DocFlavor.BYTE_ARRAY POSTSCRIPT;
    public static final DocFlavor.BYTE_ARRAY PCL;
    public static final DocFlavor.BYTE_ARRAY GIF;
    public static final DocFlavor.BYTE_ARRAY JPEG;
    public static final DocFlavor.BYTE_ARRAY PNG;
    public static final DocFlavor.BYTE_ARRAY AUTOSENSE;
class DocFlavor.CHAR_ARRAY :-
    public static final DocFlavor.CHAR_ARRAY TEXT_PLAIN;
    public static final DocFlavor.CHAR_ARRAY TEXT_HOST;
class DocFlavor.INPUT_STREAM :-
    public static final DocFlavor.INPUT_STREAM TEXT_PLAIN_HOST;
    public static final DocFlavor.INPUT_STREAM TEXT_PLAIN_UTF_8;
    public static final DocFlavor.INPUT_STREAM TEXT_PLAIN_UTF_16;
    public static final DocFlavor.INPUT_STREAM TEXT_PLAIN_UTF_16BE;
    public static final DocFlavor.INPUT_STREAM TEXT_PLAIN_UTF_16LE;
    public static final DocFlavor.INPUT_STREAM TEXT_PLAIN_US_ASCII;
    public static final DocFlavor.INPUT_STREAM TEXT_HTML_HOST;
    public static final DocFlavor.INPUT_STREAM TEXT_HTML_UTF_8;
    public static final DocFlavor.INPUT_STREAM TEXT_HTML_UTF_16;
    public static final DocFlavor.INPUT_STREAM TEXT_HTML_UTF_16BE;
    public static final DocFlavor.INPUT_STREAM TEXT_HTML_UTF_16LE;
    public static final DocFlavor.INPUT_STREAM TEXT_HTML_US_ASCII;
    public static final DocFlavor.INPUT_STREAM PDF;
    public static final DocFlavor.INPUT_STREAM POSTSCRIPT;
    public static final DocFlavor.INPUT_STREAM PCL;
    public static final DocFlavor.INPUT_STREAM GIF;
    public static final DocFlavor.INPUT_STREAM JPEG;
    public static final DocFlavor.INPUT_STREAM PNG;
    public static final DocFlavor.INPUT_STREAM AUTOSENSE;
class DocFlavor.READER :-
    public static final DocFlavor.READER TEXT_PLAIN;
    public static final DocFlavor.READER TEXT_HOST;
class DocFlavor.SERVICE_FORMATTED :-
    public static final DocFlavor.SERVICE_FORMATTED.PAGEABLE;
    public static final DocFlavor.SERVICE_FORMATTED.PRINTABLE;
    public static final DocFlavor.SERVICE_FORMATTED.RENDERABLE_IMAGE;
class DocFlavor.STRING :-
    public static final DocFlavor.STRING TEXT_PLAIN;
    public static final DocFlavor.STRING TEXT_HOST;
class DocFlavor.URL :-
    public static final DocFlavor.URL TEXT_PLAIN_HOST;
    public static final DocFlavor.URL TEXT_PLAIN_UTF_8;
    public static final DocFlavor.URL TEXT_PLAIN_UTF_16;
    public static final DocFlavor.URL TEXT_PLAIN_UTF_16BE;
    public static final DocFlavor.URL TEXT_PLAIN_UTF_16LE;
    public static final DocFlavor.URL TEXT_PLAIN_US_ASCII;
    public static final DocFlavor.URL TEXT_HTML_HOST;
    public static final DocFlavor.URL TEXT_HTML_UTF_8;
    public static final DocFlavor.URL TEXT_HTML_UTF_16;
    public static final DocFlavor.URL TEXT_HTML_UTF_16BE;
    public static final DocFlavor.URL TEXT_HTML_UTF_16LE;
    public static final DocFlavor.URL TEXT_HTML_US_ASCII;
    public static final DocFlavor.URL PDF;
    public static final DocFlavor.URL POSTSCRIPT;
    public static final DocFlavor.URL PCL;
    public static final DocFlavor.URL GIF;
    public static final DocFlavor.URL JPEG;
    public static final DocFlavor.URL PNG;
    public static final DocFlavor.URL AUTOSENSE;
 

2:  Policy on permissions for locating and using print services.

In the Proposed Final Draft there is no discussion of  the security permissions required in order to look up services and to submit
jobs for printing. The specification is proposed to be clarified and updated as follows :
 
  • Print Service Providers which implement the PrintServiceLookup class should determine whether their PrintServices should be visible to clients which do not have the appropriate permission: typically the standard  "queuePrintJob" RuntimePermission. For example access to system printers may be denied to untrusted applet code which do not hold this permission.  This is consistent with the existing behaviour that untrusted code cannot print to these printers. Note that Print Service Providers are a very small group and distinct from those developers who are using the API to print.
  • Print Service Providers which directly register a PrintService will have that PrintService be subject to the security policies in effect as determined by the Java Print Service implementation.

  •  


    ACCEPTED CHANGES

    No changes proposed to the JSR-06 specification have yet been accepted.


    DEFERRED CHANGES

    No changes proposed to the JSR-06 specification have yet been deferred.

     
     
    Copyright © 2002 by Sun Microsystems, Inc. All Rights Reserved.